'); // end : $div
if (el.opts.getUrlBy == 0) {
tmpimage.altImg = jqimage.parent().attr('href');
}
else if (el.opts.getUrlBy == 1) {
tmpimage.altImg = el.opts.fullSizePath + tmpimage.src.split('/').pop();
}
else if (el.opts.getUrlBy == 2) {
tmpimage.altImg = tmpimage.src.replace(el.opts.prefix, '');
};
this.altTxt = jqimage.attr('alt');
var image = new Image();
image.onload = function () {
image.onload = null;
jqdiv.empty().append(jqimage);
var margins = jqGalViewII.center({ "w": jqdiv.width(), "h": jqdiv.height() }, { "w": image.width, "h": image.height });
jqimage.css({ marginLeft: margins.l, marginTop: margins.t });
var largeImage = new Image();
largeImage.onload = function () {
largeImage.onload = null;
$('
').appendTo(jqdiv).css({ opacity: ".01" })
.mouseover(
function () {
var $f = $(this);
$f.css({ opacity: ".75" }).stop().animate({ opacity: ".01" }, 500);
}
)
.click(function () {
jqimage.trigger('click');
}).trigger('mouseover');
jqimage.click(function () {
jqGalViewII.view(this, el);
})
.css({ marginLeft: margins.l, marginTop: margins.t });
if (tmpimage.index == 0) {
jqimage.trigger('click');
jqimage.siblings().trigger('mouseover');
};
}; // end : largeImage.onload
largeImage.src = tmpimage.altImg;
}; // end : image.onload
image.src = tmpimage.src;
});
});
};
jqGalViewII = {
//pDem parent deminsions
//iDem img deminsions
resize: function (pDem, iDem) {
if (iDem.w > pDem.w) {
iDem.h = iDem.h * (pDem.w / iDem.w);
iDem.w = pDem.w;
if (iDem.h > pDem.w) {
iDem.w = iDem.w * (pDem.h / iDem.h);
iDem.h = pDem.h;
};
} else if (iDem.h > pDem.h) {
iDem.w = iDem.w * (pDem.h / iDem.h);
iDem.h = pDem.h;
if (iDem.w > pDem.w) {
iDem.h = iDem.h * (pDem.w / iDem.w);
iDem.w = pDem.w;
};
};
return iDem;
},
center: function (pDem, iDem) {
return { "l": (pDem.w - iDem.w) * .5, "t": 0 };
},
swapOut: function (el) {
return $('
');
},
view: function (img, el) {
if (typeof img.altImg == 'undefined') return false;
var url = img.altImg;
if (/picasa/.test(url)) {
url = /\?/.test(img.altImg) ? '&imgmax=800' : '?imgmax=800';
};
el.loader.show();
image = new Image();
image.onload = function () {
image.onload = null;
dem = {};
dem.w = $wOrg = image.width;
dem.h = $hOrg = image.height;
dem = jqGalViewII.resize({ "w": el.imgCw, "h": el.imgCh }, { "w": dem.w, "h": dem.h });
var margins = jqGalViewII.center({ "w": el.imgCw, "h": el.imgCh }, { "w": dem.w, "h": dem.h });
el.image.css({ width: dem.w, height: dem.h, marginLeft: margins.l, marginTop: margins.t });
el.loader.fadeOut('fast');
el.altTextBox.fadeTo('fast', 0.1);
el.image.fadeOut('fast', function () {
el.image.attr('src', url).fadeIn();
if (typeof img.altTxt != 'undefined') {
el.altTextBox.fadeTo("fast", el.opts.titleOpacity).text(img.altTxt);
};
});
/*
el.image.click(function(){
var src = img.altImg;
// thickbox execution code
});
*/
};
image.src = url;
},
defaults: {
getUrlBy: 0, // 0 == from parent A tag | 1 == the full size resides in another folder
fullSizePath: null,
prefix: 'thumbnail.',
titleOpacity: .60
}
};
})(jQuery);