This commit is contained in:
Sanj 2011-12-14 02:53:46 +05:30
parent 6fce1d3c3d
commit 07bea5d278

View File

@ -48,7 +48,7 @@ $('.lightboxPrev').live("click", function(e) {
$('.thumbsDetails').live("click", function(e) {
// alert($(this).attr("data-bigimage"));
var that = this;
var $that = $(this);
var totalImages = $(this).parent().find(".thumbsDetails").length;
var thisIndex = $(this).index();
@ -63,17 +63,17 @@ $('.thumbsDetails').live("click", function(e) {
var hasPrev = true;
var prevImage = $(this).parent().find(".thumbsDetails").eq(thisIndex - 1);
}
var $lbox = $('#lightboxContent');
var $lbox = $('#lightboxPanel');
var $cont = $('<div />').addClass("lightboxContainer");
var bigImage = $(this).attr("data-bigimage");
var $img = $('<img />').attr("src", bigImage).addClass("lightboxImg");
$img.appendTo($cont);
var imgWidth = parseInt($img.attr("data-width"));
var imgHeight = parseInt($img.attr("data-height"));
var imgWidth = parseInt($that.attr("data-width"));
var imgHeight = parseInt($that.attr("data-height"));
var lightboxWidth = imgWidth + 40;
var lightboxHeight = imgHeight + 60;
$('#lightboxPanel').width(lightboxWidth);
$('#lightboxPanel').height(lightboxHeight);
$lbox.width(lightboxWidth);
$lbox.height(lightboxHeight);
var viewportWidth = $(window).width();
var viewportHeight = $(window).height();
//FIXME: Add conditionals for if image bigger than viewport