[-] Fo : Fix big pic alt with jqzoom

This commit is contained in:
gRoussac committed 2013-04-16 10:22:46 +02:00
1 parent 00d7d78ba6
commit 6cdf8babca
3 files changed
+7 -5

No files matched your search

+4 -3
View File
@@ -31,9 +31,10 @@
var imageWidth = $(this).get(0).offsetWidth; var imageWidth = $(this).get(0).offsetWidth;
var imageHeight = $(this).get(0).offsetHeight; var imageHeight = $(this).get(0).offsetHeight;
noalt = $(this).attr("alt"); attr = typeof($(this).attr("rel")) != 'undefined' ? "rel" : "alt";
noalt = $(this).attr(attr);
var bigimage = noalt; var bigimage = noalt;
$(this).attr("alt", ''); $(this).attr(attr, '');
if($("div.zoomdiv").get().length == 0) if($("div.zoomdiv").get().length == 0)
$(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage+"'/></div>"); $(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage+"'/></div>");
@@ -67,7 +68,7 @@
$("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ; $("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ;
}); });
}, function() { }, function() {
$(this).attr("alt", noalt); $(this).attr(attr, noalt);
$("div.zoomdiv").hide(); $("div.zoomdiv").hide();
$(document.body).unbind("mousemove"); $(document.body).unbind("mousemove");
$(".lenszoom").remove(); $(".lenszoom").remove();
+2 -1
View File
@@ -424,7 +424,7 @@ function displayImage(domAAroundImgThumb, no_animation)
{ {
$('#bigpic').attr('src', newSrc); $('#bigpic').attr('src', newSrc);
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
$(this).attr('alt', domAAroundImgThumb.attr('href')); $('#bigpic').attr('rel', domAAroundImgThumb.attr('href'));
} }
$('#views_block li a').removeClass('shown'); $('#views_block li a').removeClass('shown');
$(domAAroundImgThumb).addClass('shown'); $(domAAroundImgThumb).addClass('shown');
@@ -528,6 +528,7 @@ $(document).ready(function()
//set jqZoom parameters if needed //set jqZoom parameters if needed
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
{ {
$('#bigpic').attr('rel', $('#bigpic').attr('src').replace('thickbox', 'large'));
$('img.jqzoom').jqueryzoom({ $('img.jqzoom').jqueryzoom({
xzoom: 200, //zooming div default width(default width value is 200) xzoom: 200, //zooming div default width(default width value is 200)
yzoom: 200, //zooming div default width(default height value is 200) yzoom: 200, //zooming div default width(default height value is 200)
+1 -1
View File
@@ -183,7 +183,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
<div id="image-block"> <div id="image-block">
{if $have_image} {if $have_image}
<span id="view_full_size"> <span id="view_full_size">
<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}" /> <img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}"{if $jqZoomEnabled} class="jqzoom"{/if} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}"/>
<span class="span_link">{l s='Maximize'}</span> <span class="span_link">{l s='Maximize'}</span>
</span> </span>
{else} {else}