<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
$.ajax({
type: "GET",
url: "json/170826_rendezvous.json", //json file
dataType: "json",
success: function(json) {
var html = '';
$.each(json.images,function(i,v) {
html += '<a class="fancybox-button" rel="fancybox-button" href="' + v.imageURL + '" title="' + v.caption + '">\
<img src="' + v.imageURL.replace('images/','images/thumb/') + '" \
alt="' + v.alt + '" title="' + v.alt + '"/></a>';
})
console.log ( html );
$('#am-container').append( html );
$(function() {
var $container
= $('#am-container'),
$imgs
= $container.find('img').hide(),
totalImgs
= $imgs.length,
cnt
= 0;
$imgs.each(function(i) {
var $img
= $(this);
$('<img/>').load(function() {
++cnt;
if( cnt === totalImgs ) {
$imgs.show();
$container.montage({
fillLastRow
: false,
alternateHeight
: true,
alternateHeightRange : {
min
: 125,
max
: 125
},
margin : 5
});
$('#overlay').fadeIn(500);
}
}).attr('src',$img.attr('src'));
});
});
}
})
$(".fancybox-button").fancybox({
prevEffect
: 'none',
nextEffect
: 'none',
closeBtn
: true,
helpers
: {
title
: { type : 'inside' },
buttons
: {}
}
});
$('.menu').fixedMenu();
});
// ]]>
</script>