Last active
February 23, 2024 15:24
-
-
Save LaxusCroco/869bee75c0012286bc3a06ce1efe4b12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function( $ ) { | |
$(window).on( 'jet-popup-open-trigger', function( event ) { | |
let id = event.popupData.postId ?? '', | |
slider = $(`#${event.popupData.popupId ?? ''} .gallery-list .jet-listing-grid__items`); | |
if ( ! slider.length ) { | |
return; | |
} | |
let index = slider.find( `[data-slick-index][data-post-id='${id}']` )[0].dataset.slickIndex; | |
if ( ! index ) { | |
return; | |
} | |
slider.slick( 'slickGoTo', `${index}` ); | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment