Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

petter

Tool tip parou de funcionar.

Recommended Posts

Pessoal tenho um tool tip que misteriosamente parou de funcionar, ele está da seguinte forma:

arquivo.js


function init_tooltip()

{

 

tooltip = document.getElementById('tooltip');

document.onmousemove = move_tooltip;

 

ancora = document.getElementsByTagName('a');

 

for(i = 0; i < ancora.length; i ++){

a = ancora;

texttitle = a.getAttribute('title');

if(texttitle){

a.setAttribute("tTitle", texttitle);

a.removeAttribute("title");

a.onmouseover = function()

{

t = this.getAttribute('tTitle');

mostra_tooltip(t);

}

a.onmouseout = function()

{

oculta_tooltip();

}

}

}

}

 

function mostra_tooltip(texto)

{

tooltip.innerHTML = texto;

tooltip.style.display = 'block';

}

 

function oculta_tooltip()

{

tooltip.innerHTML = '';

tooltip.style.display = 'none';

}

 

function move_tooltip(e)

{

e = e || window.event;

if(e.pageX || e.pageY){

x = e.pageX;

y = e.pageY;

}else{

x = event.clientX;

y = event.clientY;

}

 

tooltip.style.left = (x+10)+'px';

tooltip.style.top = (y-25)+'px';

tooltip.style.position = 'absolute';

 

return true;

}

_linenums:0'>var tooltip = '';function init_tooltip(){tooltip = document.getElementById('tooltip');document.onmousemove = move_tooltip;ancora = document.getElementsByTagName('a');for(i = 0; i < ancora.length; i ++){a = ancora;texttitle = a.getAttribute('title');if(texttitle){a.setAttribute("tTitle", texttitle);a.removeAttribute("title");a.onmouseover = function(){t = this.getAttribute('tTitle');mostra_tooltip(t);}a.onmouseout = function(){oculta_tooltip();}}}}function mostra_tooltip(texto){tooltip.innerHTML = texto;tooltip.style.display = 'block';}function oculta_tooltip(){tooltip.innerHTML = '';tooltip.style.display = 'none';}function move_tooltip(e){e = e || window.event;if(e.pageX || e.pageY){x = e.pageX;y = e.pageY;}else{x = event.clientX;y = event.clientY;}tooltip.style.left = (x+10)+'px';tooltip.style.top = (y-25)+'px';tooltip.style.position = 'absolute';return true;}

E no HTML

window.onload = function(){ init_tooltip(); }

No firebug acusa erro nessa linha:


_linenums:0'>tooltip.style.left = (x+10)+'px';

Alguém pode dar uma ajuda sobre esse erro?

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.