Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/10/2011, 01:24
oliverarthurnardi
 
Fecha de Ingreso: noviembre-2010
Ubicación: aun no se donde vivir
Mensajes: 112
Antigüedad: 13 años, 7 meses
Puntos: 3
tjpzoom.js no me funciona en firefox pero si en IE y chrome

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 original
  1. function TJPzoomswitch(obj) {
  2.  TJPon[obj]=((TJPon[obj])?(0):(1));
  3.  return TJPon[obj];
  4. }
  5.  
  6. function TJPzoomif(obj,highres) {
  7.  if(TJPon[obj]) {TJPzoom(obj,highres);}
  8. }
  9.  
  10. function TJPzoom(obj,highres) {
  11.  if(!obj.style.width) {
  12.   if(obj.width > 0) {
  13.    //educated guess
  14.    obj.style.width=obj.width+'px';
  15.    obj.style.height=obj.height+'px';
  16.   }
  17.  }
  18.  if(typeof(highres) != typeof('')) {highres=obj.src}
  19.  var TJPstage=document.createElement("div");
  20.  TJPstage.style.width=obj.style.width;
  21.  TJPstage.style.height=obj.style.height;
  22.  TJPstage.style.overflow='hidden';
  23.  TJPstage.style.position='absolute';
  24.  if(typeof(TJPstage.style.filter) != typeof(nosuchthing)) {
  25.   //hi IE
  26.   if(navigator.appVersion.indexOf('Mac') == -1) { //hi Mac IE
  27.    TJPstage.style.filter='alpha(opacity=0)';
  28.    TJPstage.style.backgroundColor='#ffffff';
  29.   }
  30.  } else {
  31.   //hi decent gentlemen
  32.   TJPstage.style.backgroundImage='transparent';
  33.  }
  34.  TJPstage.setAttribute('onmousemove','TJPhandlemouse(event,this);');
  35.  TJPstage.setAttribute('onmousedown','TJPhandlemouse(event,this);');
  36.  TJPstage.setAttribute('onmouseup','TJPhandlemouse(event,this);');
  37.  TJPstage.setAttribute('onmouseout','TJPhandlemouse(event,this);');
  38.  if(navigator.userAgent.indexOf('MSIE')>-1) {
  39.   TJPstage.onmousemove = function() {TJPhandlemouse(event,this);}
  40.   TJPstage.onmousedown = function() {TJPhandlemouse(event,this);}
  41.   TJPstage.onmouseup = function() {TJPhandlemouse(event,this);}
  42.   TJPstage.onmouseout = function() {TJPhandlemouse(event,this);}
  43.  }
  44.  obj.parentNode.insertBefore(TJPstage,obj);
  45.  
  46.  TJPwin=document.createElement("div");
  47.  TJPwin.style.width='0px';
  48.  TJPwin.style.height='0px';
  49.  TJPwin.style.overflow='hidden';
  50.  TJPwin.style.position='absolute';
  51.  tw1='<div style="position:absolute;overflow:hidden;margin:';
  52.  TJPwin.innerHTML=
  53.  tw1+TJPshadowthick+'px 0 0 '+TJPshadowthick+'px; background-color:'+TJPbordercolor+'; width:'+(TJPzoomwidth-TJPshadowthick*2)+'px;height:'+(TJPzoomheight-TJPshadowthick*2)+'px"></div>' +
  54.  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>';
  55.  if(highres != obj.src) {
  56.   TJPwin.innerHTML+='<div style="position:absolute; margin:'+(TJPshadowthick+TJPborderthick)+'px 0 0 '+(TJPshadowthick+TJPborderthick)+'px;">'+TJPloading+'</div>';
  57.  }