DHTML and Mouse Position Oddity

Results 1 to 2 of 2

Thread: DHTML and Mouse Position Oddity

  1. #1
    SPG Guest

    Default DHTML and Mouse Position Oddity

    This is a client-side question, but given that there&#039s an off chance somebody knows the answer, I&#039ll go off topic with the question...<BR><BR>In MSIE (maybe in others, too), when positioning pop-up layers based on the mouse "event", if the user has scrolled down in the page, the event sends the mouse location in the window and the pop up is positioned in the document (where the mouse would have been had the user not scrolled down). This tends to be a bad thing (can&#039t think of a way to make it a feature yet), so...<BR><BR>I&#039m wondering if anybody knows of a workaround to get the document (as opposed to the de facto Window) position from the mouse.<BR><BR>tfaa

  2. #2
    Bruno Santos Guest

    Default RE: DHTML and Mouse Position Oddity

    Hi SPG!<BR><BR>To obtain the real TOP value for the controls/styles, you should add the mouse position with the document.body.scrollTop or window.pageYOffset, as follows:<BR><BR>var mymousepos=??????<BR>var myrealpos=mymousepos+(document.all?document.body.s crollTop:window.pageYOffset)<BR><BR><BR>Bruno (brunosantos@rj.net)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts