Created
May 16, 2016 22:35
-
-
Save cballou/c4a254d1cc56741f594f86ac08c39389 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
// default lightbox options | |
$.fn.lightweight.defaults = { | |
height: 260, | |
width: 380, | |
color: '#fff', | |
bgColor: '#000', | |
bgOpacity: .5, | |
overlayColor: '#000', | |
overlayOpacity: .8, | |
fadeSpeed: 400, | |
borderRadius: 10, | |
closeClass: '.close' | |
}; |
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
// open the target element with ID "targetElement" (assumes it's already hidden by end user via style="display:none") | |
$('#targetElement').lightweight({ | |
height: 400, | |
width: 400 | |
}); | |
// to manually close the lightbox | |
$('#targetElement').lightweight('close'); | |
// an example of binding a button to close the lightbox | |
$('#targetElement a.close').on('click', function() { | |
$this.lightweight('close'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment