Created
February 20, 2020 13:28
-
-
Save KittenCodes/746a6ee7b0bd2cc3f34e4a059781fc5a to your computer and use it in GitHub Desktop.
jQuery to create Lightbox popup using Oxygen's Modal element
This file contains 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('.lightbox-trigger').click( function() { | |
var image = jQuery(this).attr('src'); | |
jQuery('.lightbox-popup').css('background-image', 'url(' + image + ')'); | |
var caption = jQuery(this).next().text(); | |
jQuery('.lightbox-popup-caption').text( caption ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment