Created
July 21, 2012 23:48
-
-
Save plusjade/3157570 to your computer and use it in GitHub Desktop.
lightbox.js customization for pragmatically setting options and initializing
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
<!-- | |
In lightbox.js you need to remove the initialization function call at the bottom. | |
Lines highlighted here: https://github.com/lokesh/lightbox2/blob/master/js/lightbox.js#L345-349 | |
This is what "starts" lightbox. | |
Place the initialization function at the bottom of one of your html layouts like so: | |
--> | |
<script> | |
$(function() { | |
var lightbox, options; | |
options = new LightboxOptions; | |
options.fileLoadingImage = 'images/loading.gif'; | |
options.fileCloseImage = 'images/close.png'; | |
return lightbox = new Lightbox(options); | |
}); | |
</script> | |
<!-- | |
Once it's in the layouts.html file, you are free to use the mustache syntax to replace the image paths: | |
--> | |
<script> | |
$(function() { | |
var lightbox, options; | |
options = new LightboxOptions; | |
options.fileLoadingImage = '{{urls.media}}/loading.gif'; | |
options.fileCloseImage = '{{urls.media}}/close.png'; | |
return lightbox = new Lightbox(options); | |
}); | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment