Firefox offsetLeft problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top