Skip to content

Instantly share code, notes, and snippets.

@jameschambers
Created April 22, 2013 10:14
Show Gist options
  • Save jameschambers/5433746 to your computer and use it in GitHub Desktop.
Save jameschambers/5433746 to your computer and use it in GitHub Desktop.
// Info on loading images via JSON http://galleria.io/docs/references/data/
var images = {
"image": "http://image.url"
}
Galleria.run(s.galleryElem, {
dataSource: images,
preload: 1,
transition: 'fade',
imageCrop: true,
thumbnails: false,
showInfo: false,
debug: true,
showImageNav: true,
extend: function () {
var gallery = this;
/* Set the slide numbers
------------------------------------------------- */
$('.total-slide-num').html(gallery.getDataLength());
// Fired every time an image shows
gallery.bind("image", function (e) {
// Ensure the gallery is visible
$(s.galleryElem).animate({'opacity': 1}, 0, function () {
// Toggle the body colour
toggleBodyColor(e.galleriaData.dataColor);
});
$('.current-slide-num').html(gallery.getIndex() + 1);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment