From 50528a5fe3c28e95ccbbcc5cbb42049ae667a981 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 22 Apr 2013 09:40:48 +0200 Subject: [PATCH] [*] FO : Wait for the image to be loaded before displaying the big image on product page - thanks to @romainberger --- themes/default/js/product.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 7bae47cc0..9ff798a8f 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -422,9 +422,11 @@ function displayImage(domAAroundImgThumb, no_animation) var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); if ($('#bigpic').attr('src') != newSrc) { - $('#bigpic').attr('src', newSrc); - if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $('#bigpic').attr('rel', domAAroundImgThumb.attr('href')); + $(this).attr('src', newSrc).load(function() { + $(this).show(); + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + $(this).attr('alt', domAAroundImgThumb.attr('href')); + }); } $('#views_block li a').removeClass('shown'); $(domAAroundImgThumb).addClass('shown');