var earlyResetLoadOverScreen = false; function largeImageLoaded() { if(!earlyResetLoadOverScreen) { var top = Math.round(($(window).height() - (this.height + 50)) /2); var left = Math.round(($(window).width() - (this.width + 50)) /2); if(top < 0) top = 0; if(left < 0) left = 0; if((this.height + 40) > $(window).height()) { $('#overlayContainer').css('height', (this.height + 50)+'px'); } if((this.width + 40) > $(window).width()) { $('#overlayContainer').css('width', (this.width + 50)+'px'); } $('#largeImageSource').html('
close
'); $('#loadingLargeContainer').fadeOut(300, function() {$(this).remove();}); $('.maskHSide', '#loadingImageOverScreen').animate({width: (this.width - 30)}, 300); $('.maskVSide', '#loadingImageOverScreen').animate({height: (this.height - 30)}, 300); $('.maskRoundedContent', '#loadingImageOverScreen').animate({height: (this.height - 10)}, 300); $('#loadingImageOverScreen').animate({ width: this.width, height: this.height, top: top, left: left }, 300);//, 'linear', function() { //}); $('#largeImageSource').click(function() { $('#overlayContainer').fadeOut('fast', function() { $('#overlayContainer').remove(); }); }); $('#loadingLargeContainer').fadeOut(300, function() { $('#largeImageLoader').fadeIn(300); }); } } function earlyResetLoadImageOverScreen() { earlyResetLoadOverScreen = true; $('#loadingLargeContainer').fadeOut('fast', function() { $('#overlayContainer').remove(); }); } function loadImageOverScreen(imageSrc) { var html = ""; html += "
"; html += "
 
"; html += "
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
 
"; html += "
"; html += ""; html += "
"; html += "
 
"; html += "
"; html += "
"; html += "
"; html += "
"; $('body').append(html); $('#overlayContainer').fadeIn('fast', function() { var largeImg = new Image(); largeImg.onload = largeImageLoaded; largeImg.src = imageSrc; }); }