Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/11/2011, 03:43
reonevk
 
Fecha de Ingreso: enero-2010
Mensajes: 97
Antigüedad: 14 años, 3 meses
Puntos: 3
Exclamación fuciona en chrome y firefox PERO NO EN IE!!

buenas, la cosa es que este codigo javascript-jquery me funciona perfectamente en chrome y firefox pero no en Internet Explorer, alguien me puede decir donde esta el fallo???
---------------
function createTooltipEvents()
{
//insert the tooltip separators in tooltipLayer
$("#tooltipLayer").html('<table width="210" border="0" cellspacing="0" cellpadding="0"><tr><td width="5" height="5" background="/images/separators/tooltip/upleft.jpg"></td><td width="200" height="5" background="/images/separators/tooltip/horizontal.jpg"></td><td width="5" height="5" background="/images/separators/tooltip/upright.jpg"></td></tr><tr><td width="5" background="/images/separators/tooltip/vertical.jpg"></td><td width="200" bgcolor="#151515" id="tooltipCenter" align="center"></td><td width="5" background="/images/separators/tooltip/vertical.jpg"></td></tr><tr><td width="5" height="5" background="/images/separators/tooltip/downleft.jpg"></td><td width="200" height="5" background="/images/separators/tooltip/horizontal.jpg"></td><td width="5" height="5" background="/images/separators/tooltip/downright.jpg"></td></tr></table>');


//initialize the center as loading...
$("#tooltipCenter").html('<tr><td class="WhiteBold12" align="center">Cargando...</td></tr>');
const maxInventory = 24;
var elements = new Array();
for ( i = 1; i <= maxInventory; i++)
{
elements[i] = new Array(2)
elements[i] = ['item'+i,'Cargando...'];
}
jQuery.each(elements, function(i)
{
var name = "#"+this[0];
conectionAjax(elements,i);

//+++++**mouseover**++++++
$(name).mouseover(function()
{
//get the x,y coordinates
//--x--
var x = $(name).offset().left;
if(x >= 340)
{
x -= 210; //coordenada X si sale a la izquierda
}else{
x += 80; //Get X coodrinates
}
//--y--
var y = $(name).offset().top;
//set de coordinates on tooltipLayer
$("#tooltipLayer").css( "left",x );
$("#tooltipLayer").css( "top",y );

//set the tooltip in information
//...
$("#tooltipCenter").html(elements[i][1]);
//pasao = name.replace("#", "");
//mostrar = conectionAjax(pasao)

//$("#tooltipCenter").html(elements[1][0]);

//show the tooltipLayer
$("#tooltipLayer").show();
});
//+++++**mouseout**++++++
$(name).mouseout(function()
{
$("#tooltipLayer").hide();
$("#tooltipCenter").html('<tr><td class="WhiteBold12" align="center">Cargando...</td></tr>');
});
});
};

/**
*
* Funtion that creates the ajax object
**/

function createAjax()
{

var xmlhttp=false;
try
{
// Creacion del objeto AJAX para navegadores no IE
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
// Creacion del objet AJAX para IE
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E) { xmlhttp=false; }
}
if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); }

return xmlhttp;
}


/**
*
* Funtion that makes the conection with the php
**/

function conectionAjax(elements,id)
{
var ajax=createAjax();
ajax.open("POST", "getTooltip.php", true);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
if( ajax.status == 200 )
{
// Muestro el mensaje enviado desde el servidor
elements[id][1] = ajax.responseText;
}
}

}
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send("id="+id);
}
-------------------
gracias de antemano.