rediculous event.offsetX/event.clientX positioning

Y

Yereth Jansen

Hi all,

I am building my rightclick-menu into a dtree (javascript tree view). I
encountered a problem when right-clicking on the text within this tree,
namely that the event.offsetX is totally out of position when it is
called. The funny thing is that when I right-click on any of the images
the right-click menu shows exactly where the mouse-cursor is positioned
and it only acts funny when the link is right-clicked. This is my code,
with the css classes and ids removed to make it more readible:
---------------------------
<div class="dtree">
<div oncontextmenu="return launchContextMenu(0)">
<img src="folderopen.gif" />
<a href="url" onmouseover="window.status='root';return true;"
onmouseout="window.status='';return true;">root</a>
<div style="display:block;">
<div oncontextmenu="return launchContextMenu(3)">
<img src="joinbottom.gif" alt="" />
<img src="folderopen.gif" alt="" />
<a href="url" onmouseover="window.status='test';return true;"
onmouseout="window.status='';return true;" onclick="javascript:
documents.s(5);">test</a>
</div>
</div>
</div>
</div>
---------------------------
I use internet explorer 6. launchContextMenu() shows the right-click menu.

For the mouseposition I use the following code:
var left = event.offsetX;
var right = event.offsetY;

screenX and screenY act normal and return expected values.

Is anyone familiar with this problem? (the scrollbars are not the
problem, I tested that already.)

Thanks in advance,
Yereth
 

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