Skip to content

Instantly share code, notes, and snippets.

@fjaguero
Created July 26, 2012 15:07
Show Gist options
  • Save fjaguero/3182605 to your computer and use it in GitHub Desktop.
Save fjaguero/3182605 to your computer and use it in GitHub Desktop.
Extend Galleria using Lightbox when clicking the main image -for Desktops-
// 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