Hola buenas chicos!!
tengo el siguiente script en mi página y me ha surgido un problema que cuando lo pruebo en firefox no me funciona.... cuando paso la lupa por encima de la imagen la imagen se me desaparece y el IE y los demas navegadores me funciona.
1ª parte del script:
Código Javascript
:
Ver originalfunction TJPzoomswitch(obj) {
TJPon[obj]=((TJPon[obj])?(0):(1));
return TJPon[obj];
}
function TJPzoomif(obj,highres) {
if(TJPon[obj]) {TJPzoom(obj,highres);}
}
function TJPzoom(obj,highres) {
if(!obj.style.width) {
if(obj.width > 0) {
//educated guess
obj.style.width=obj.width+'px';
obj.style.height=obj.height+'px';
}
}
if(typeof(highres) != typeof('')) {highres=obj.src}
var TJPstage=document.createElement("div");
TJPstage.style.width=obj.style.width;
TJPstage.style.height=obj.style.height;
TJPstage.style.overflow='hidden';
TJPstage.style.position='absolute';
if(typeof(TJPstage.style.filter) != typeof(nosuchthing)) {
//hi IE
if(navigator.appVersion.indexOf('Mac') == -1) { //hi Mac IE
TJPstage.style.filter='alpha(opacity=0)';
TJPstage.style.backgroundColor='#ffffff';
}
} else {
//hi decent gentlemen
TJPstage.style.backgroundImage='transparent';
}
TJPstage.setAttribute('onmousemove','TJPhandlemouse(event,this);');
TJPstage.setAttribute('onmousedown','TJPhandlemouse(event,this);');
TJPstage.setAttribute('onmouseup','TJPhandlemouse(event,this);');
TJPstage.setAttribute('onmouseout','TJPhandlemouse(event,this);');
if(navigator.userAgent.indexOf('MSIE')>-1) {
TJPstage.onmousemove = function() {TJPhandlemouse(event,this);}
TJPstage.onmousedown = function() {TJPhandlemouse(event,this);}
TJPstage.onmouseup = function() {TJPhandlemouse(event,this);}
TJPstage.onmouseout = function() {TJPhandlemouse(event,this);}
}
obj.parentNode.insertBefore(TJPstage,obj);
TJPwin=document.createElement("div");
TJPwin.style.width='0px';
TJPwin.style.height='0px';
TJPwin.style.overflow='hidden';
TJPwin.style.position='absolute';
tw1='<div style="position:absolute;overflow:hidden;margin:';
TJPwin.innerHTML=
tw1+TJPshadowthick+'px 0 0 '+TJPshadowthick+'px; background-color:'+TJPbordercolor+'; width:'+(TJPzoomwidth-TJPshadowthick*2)+'px;height:'+(TJPzoomheight-TJPshadowthick*2)+'px"></div>' +
tw1+(TJPshadowthick+TJPborderthick)+'px 0 0 '+(TJPshadowthick+TJPborderthick)+'px; width:'+(TJPzoomwidth-TJPshadowthick*2-TJPborderthick*2)+'px;height:'+(TJPzoomheight-TJPshadowthick*2-TJPborderthick*2)+'px;"><img src="'+highres+'" style="margin:0;padding:0;border:0; width:'+(TJPzoomamount*parseInt(obj.style.width))+'px;height:'+(TJPzoomamount*parseInt(obj.style.height))+'px;" '+((highres != obj.src)?('onload="if(this.parentNode) {this.parentNode.parentNode.getElementsByTagName(\'div\')[2].style.display=\'none\';}"'):(''))+'/></div>';
if(highres != obj.src) {
TJPwin.innerHTML+='<div style="position:absolute; margin:'+(TJPshadowthick+TJPborderthick)+'px 0 0 '+(TJPshadowthick+TJPborderthick)+'px;">'+TJPloading+'</div>';
}