I have this tooltip javascript that works fine in Internet Explorer but does not execute in Firefox:
.js file contains:
tags=new Array(
'a',
'img',
'td'
);
bg_color='ffffff';
text_color='black';
font='arial';
text_size='9';
opacity='80';
d=document;
[removed]('<div id="floating_info" style="padding:1 3;position:absolute;border-top-width: 1px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-top-style: dotted;border-right-style: solid;border-bottom-style: solid;border-left-style: dotted;border-top-color: 777777;border-right-color: 333333;border-bottom-color: 333333; border-left-color: 777777; background:ffffff;font:bold '+text_size+'px '+font+';color:'+text_color+';display:none;width:150;z-index:2000;filter:alpha(opacity='+opacity+')"></div>')
document.onmousemove=move;
document.onmouseout="info('','off')"
function info(tip,optiune){
b=document.getElementById('floating_info')
if (optiune=='on'){
b.style.display="block";
b[removed]=tip;
}
if (optiune=='off'){b.style.display="none";b[removed]=''}
}
function move(){
b=document.getElementById('floating_info')
if(event.clientX<d.body.clientWidth-120)
{b.style.left=event.x+9+d.body.scrollLeft;}
else {b.style.left=event.x-108+d.body.scrollLeft;}
if(event.clientY>d.body.clientHeight-50)
{b.style.top=event.y-40+d.body.scrollTop;}
else {b.style.top=event.y-20+d.body.scrollTop;}
}
function over(){
for(k=0;k<tags.length;k++){
obj=d.getElementsByTagName(tags[k])
for(i=0;i<obj.length;i++){
if(obj[i].getAttribute('info')){
obj[i].onmouseover = function(){info(this.getAttribute('info'),'on')};
obj[i].onmouseout = function(){info('','off')};
}}
}
};
window.onload=over
The issue might be related to the non execution of “window.onload=over” in firefox as trying window.onload=window.alert(‘Works!’);” does not return anything in firefox.