Hi.
I've created this little window that is shown when I roll the mouse over elements I specify in my html code.
Like a nubbin I test this in IE while I'me writing it, thinking it can hardly be that hard to modify for the other browsers when I'm done.
Now it works perfectly in IE but no matter what I do I can not make it work for Firefox or Opera.
Please, can anybody tell me what those !#"#$%%) browsers arn't understanding? :P
This is what I think is causing the problem.
Full code is here
[HTML]<!--
Panel that opens the ToolTip
-->
<div
id="mydiv"
onmouseover="ja vascript:ToolTi p.Show('What?') ;"
onmouseout="jav ascript:ToolTip .Hide();"
style="
position: absolute;
left: 150px;
top: 50px;
width:200px;
height:200px;
background-color:#000000;"
></div>
<!--
ToolTip panel
-->
<div
id="fdiv"
style="
visibility: visible;
position: absolute;
left: 300px;
top: 300px;
width:100px;
background-color:#555555;
border: solid 2px red;"
></div>[/HTML]
I've created this little window that is shown when I roll the mouse over elements I specify in my html code.
Like a nubbin I test this in IE while I'me writing it, thinking it can hardly be that hard to modify for the other browsers when I'm done.
Now it works perfectly in IE but no matter what I do I can not make it work for Firefox or Opera.
Please, can anybody tell me what those !#"#$%%) browsers arn't understanding? :P
This is what I think is causing the problem.
Full code is here
Code:
ToolTip.prototype.Update = function()
{
// Get mouse position
if (browser == "MSIE") {
// Internet Explorer (Also works for Opera)
MouseX = window.event.x+document.body.scrollLeft;
MouseY = window.event.y+document.body.scrollTop;
Width = document.body.clientWidth+document.body.scrollLeft;
Height = document.body.clientHeight+document.body.scrollTop;
} else {
// Netscape, (Firefox, Opera, ...)
MouseX = e.pageX;
MouseY = e.pageY;
Width = window.innerWidth+window.pageXOffset;
Height = window.innerHeight+window.pageYOffset;
}
// Get element
var element = $(ToolTip.elem);
element.style.visibility = "visible";
element.style.width = ToolTip.Width;
element.style.backgroundColor = ToolTip.backgroundColor;
element.style.border = "solid 2px "+ ToolTip.borderColor;
element.style.padding = "3px";
element.innerHTML = ToolTip.Text;
element.style.left = MouseX + 10;//(MouseX - parseInt(elemt.style.width.replace("px")));
element.style.top = MouseY;
}
Panel that opens the ToolTip
-->
<div
id="mydiv"
onmouseover="ja vascript:ToolTi p.Show('What?') ;"
onmouseout="jav ascript:ToolTip .Hide();"
style="
position: absolute;
left: 150px;
top: 50px;
width:200px;
height:200px;
background-color:#000000;"
></div>
<!--
ToolTip panel
-->
<div
id="fdiv"
style="
visibility: visible;
position: absolute;
left: 300px;
top: 300px;
width:100px;
background-color:#555555;
border: solid 2px red;"
></div>[/HTML]
Comment