Add generic code to build album of all images
This commit is contained in:
36
assets/js/gallery.js
Normal file
36
assets/js/gallery.js
Normal file
@@ -0,0 +1,36 @@
|
||||
$(function(){
|
||||
$.get('./index.json', function(data) {
|
||||
var items = $.map(data.images, function(img) {
|
||||
return {
|
||||
src: img.url,
|
||||
srct: img.thumbnail,
|
||||
height: img.height,
|
||||
width: img.width,
|
||||
}
|
||||
});
|
||||
|
||||
$('#gallery').nanogallery2({
|
||||
thumbnailHeight: 200,
|
||||
thumbnailWidth: 'auto',
|
||||
|
||||
thumbnailGutterWidth: 10,
|
||||
thumbnailGutterHeight: 10,
|
||||
|
||||
thumbnailDisplayTransition: 'scaleUp',
|
||||
thumbnailDisplayTransitionDuration: 700,
|
||||
|
||||
thumbnailHoverEffect2: 'toolsAppear|scale120|borderLighter',
|
||||
|
||||
// thumbnailToolbarImage: {
|
||||
// topLeft: 'share|download',
|
||||
// },
|
||||
|
||||
viewerGallery: 'bottom',
|
||||
viewerTools: {
|
||||
topRight: 'zoomButton, fullscreenButton, downloadButton, closeButton',
|
||||
},
|
||||
|
||||
items,
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user