Last active
November 13, 2015 21:36
-
-
Save ericakfranz/7b87a150132842e1f383 to your computer and use it in GitHub Desktop.
Trigger click on image in an Envira gallery to load it's lightbox when the page finishes loading.
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
// Target the first linked image in the gallery - best when loading a single gallery on the page | |
jQuery(window).load(function(){ | |
jQuery(".envira-gallery-wrap .envira-gallery-item:first-child a").trigger('click'); | |
}); |
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
// Target a specific linked image in the gallery - best when loading multiple galleries on the page | |
jQuery(window).load(function(){ | |
jQuery(".envira-gallery-146").trigger('click'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment