G
Gary Coutts
Hi,
I am developing a website using Visual Studio .Net 2003.
When reading offsetLeft, in a javascript function, the result is fine when
run under I.E. but gives wrong results when run under Firefox. The HTML and
java are shown below:
/-------------------------------HTML-------------------------------------------------------/
<table width="800" id="shopPanel" align="center" height=780 border=1
bordercolor=#000000>
<tr>
<td>
<label>test</label>
</td>
</tr>
</table>
/---------------------------------Java---------------------------------------------------------/
var Panel ;
function GetPosition()
{
var Left ;
var ParentLeft ;
Panel = document.getElementById("shopPanel") ;
Left = Panel.offsetLeft ;
ParentLeft = Panel.offsetParent.offsetLeft ;
}
The Java function results give the following:
IE Left - 132 Parent Left - 0
Firefox Left - 8 Parent Left - 0
Does anyone have any suggestions as to the cause of the above problem?
Cheers
Gary Coutts
I am developing a website using Visual Studio .Net 2003.
When reading offsetLeft, in a javascript function, the result is fine when
run under I.E. but gives wrong results when run under Firefox. The HTML and
java are shown below:
/-------------------------------HTML-------------------------------------------------------/
<table width="800" id="shopPanel" align="center" height=780 border=1
bordercolor=#000000>
<tr>
<td>
<label>test</label>
</td>
</tr>
</table>
/---------------------------------Java---------------------------------------------------------/
var Panel ;
function GetPosition()
{
var Left ;
var ParentLeft ;
Panel = document.getElementById("shopPanel") ;
Left = Panel.offsetLeft ;
ParentLeft = Panel.offsetParent.offsetLeft ;
}
The Java function results give the following:
IE Left - 132 Parent Left - 0
Firefox Left - 8 Parent Left - 0
Does anyone have any suggestions as to the cause of the above problem?
Cheers
Gary Coutts