beretta
10-22-2003, 08:33 AM
I am trying to convert a webpage from N4 to IE5.5 changing document.labels to document.getElementById or document.all (both should work in IE 5.5) but I can't get a mouseover event to display in IE. I have also nested the labels tags in the div tags as IE does not support the Labels tag.
Here's how the code looks...
<html>
<head>
<body bgcolor="FFFFFF" text="000000">
</head>
<script>
function getpos(evt)
{
current=this;
current.mouseX=evt.pageX;
current.mouseY=evt.pageY;
}
var DHTML = (document.getElementById || document.all || document.layers);
function getObj(id)
{
if (document.getElementById)
{
this.obj = document.getElementById('id');
this.style = document.getElementById('id').style;
}
else if (document.all)
{
this.obj = document.all['id'];
this.style = document.all['id'].style;
}
else if (document.layers)
{
this.obj = document.layers['id'];
this.style = document.layers['id'];
}
}
function GetInfo()
{
if (!DHTML) return;
var x = new getObj('id');
x.style.src = "GetInfo.html";//my popup box should be displayed here but it does not in IE!!!
x.style.moveTo(this.mouseX+10,this.mouseY+10);
x.style.visibility = 'visible';
}
function HideInfo()
{
if (!DHTML) return;
var x = new getObj('id');
x.style.visibility = 'hidden';
}
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=getpos
</script>
<body link= black >
<div id="layerA" left:0px; top:0px;>
<layer id=layerA left=0px top=0px>
//Then there is some php, here's a section of the code...
<script language="php">
echo " <tr>";echo "<th align=left><input type=checkbox value=$curDid name=OKS[] checked><a href = \"javascript:return(0)\" onmouseover=GetInfo() onmouseout=HideInfo()>$curDid</a> </th>\n";
}
?>
</layer>
</div>
//....and then the label and div tags right at the end...
<div id="id">
<layer id=id>
</layer>
</div>
I should get a 'GetInfo.html' popup when I mouseover the $curDid variable, but no matter what I do it is not displayed... any ideas?
Cheers
Here's how the code looks...
<html>
<head>
<body bgcolor="FFFFFF" text="000000">
</head>
<script>
function getpos(evt)
{
current=this;
current.mouseX=evt.pageX;
current.mouseY=evt.pageY;
}
var DHTML = (document.getElementById || document.all || document.layers);
function getObj(id)
{
if (document.getElementById)
{
this.obj = document.getElementById('id');
this.style = document.getElementById('id').style;
}
else if (document.all)
{
this.obj = document.all['id'];
this.style = document.all['id'].style;
}
else if (document.layers)
{
this.obj = document.layers['id'];
this.style = document.layers['id'];
}
}
function GetInfo()
{
if (!DHTML) return;
var x = new getObj('id');
x.style.src = "GetInfo.html";//my popup box should be displayed here but it does not in IE!!!
x.style.moveTo(this.mouseX+10,this.mouseY+10);
x.style.visibility = 'visible';
}
function HideInfo()
{
if (!DHTML) return;
var x = new getObj('id');
x.style.visibility = 'hidden';
}
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=getpos
</script>
<body link= black >
<div id="layerA" left:0px; top:0px;>
<layer id=layerA left=0px top=0px>
//Then there is some php, here's a section of the code...
<script language="php">
echo " <tr>";echo "<th align=left><input type=checkbox value=$curDid name=OKS[] checked><a href = \"javascript:return(0)\" onmouseover=GetInfo() onmouseout=HideInfo()>$curDid</a> </th>\n";
}
?>
</layer>
</div>
//....and then the label and div tags right at the end...
<div id="id">
<layer id=id>
</layer>
</div>
I should get a 'GetInfo.html' popup when I mouseover the $curDid variable, but no matter what I do it is not displayed... any ideas?
Cheers