function viewImage(img) { $.fancybox.open({src:img}); } function resizeImages(objs, maxSize) { objs.each(function() { var obj = $(this); var w = parseInt(obj.attr("width"), 10) || parseInt(obj.css("width"), 10); var h = parseInt(obj.attr("height"), 10) || parseInt(obj.css("height"), 10); if(w > maxSize) { obj.css({"width": maxSize+"px", "height": Math.round(h * (maxSize / w))+"px", "cursor":"pointer"}); } obj.show(); }); } function imagesLoad(objs) { if (objs.length) { objs.each(function() { $(this).css({"cursor": "pointer"}); $(this).attr({"data-fancybox":"gallery", "data-src":$(this).attr("src")}); }); // Fancybox.bind("[data-fancybox]", {}); } }