Created
July 26, 2012 15:07
-
-
Save fjaguero/3182605 to your computer and use it in GitHub Desktop.
Extend Galleria using Lightbox when clicking the main image -for Desktops-
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
// Remember to load jQuery & Galleria.Js | |
<script> | |
// Load the classic theme | |
Galleria.loadTheme('galleria.classic.js'); | |
// Initialize Galleria | |
Galleria.run('#galleria', { | |
extend: function(options) { | |
Galleria.log(this) // the gallery instance | |
Galleria.log(options) // the gallery options | |
// listen to when an image is shown | |
this.bind('image', function(e) { | |
Galleria.log(e) // the event object may contain custom objects, in this case the main image | |
Galleria.log(e.imageTarget) // the current image | |
// lets make galleria open a lightbox when clicking the main image: | |
jQuery(e.imageTarget).click(this.proxy(function() { | |
this.openLightbox(); | |
})); | |
}); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment