You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
786 B
JavaScript
26 lines
786 B
JavaScript
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]", {});
|
|
}
|
|
}
|