Javascript and Style coordinates Question



I have a little <Div> following the Mousecursor on mousemove event of
page...

refObject.style.top = event.y
refObject.style.left = event.x

It works fine... BUT when there's a lot more on the page (a growing
Datagrid) which make page need to scroll and you scroll down... the
coordinates does not match the mouscursor anymore since the Top value is not
getting as big as it needs from the event.y property

So how do I calculate how much I have to add to the top style value or can I
somehow convert the event.y to the actualy value from the Top of the page?

best Regards/

Lars Netzel








.



Relevant Pages

  • Re: overflow:auto (or scoll) and height:100%
    ... recompute the proper size of the div. ... scrolled by setting overflow: scroll. ... // Get the height computed by the table formatter for this cell in the ... which now overflows and produces scrollbars. ...
    (comp.infosystems.www.authoring.html)
  • Re: viewable coordinates of an element
    ... javascript and web design as a whole, ... Is there a way to like when i scroll the DIV to this element, ...
    (comp.lang.javascript)
  • Re: positioning div relative to window
    ... Fixed elements are supported by IE7 in strict mode, it acts like IE6 in quirks mode. ... And let them scroll the div element instead of the body. ... The comments are not processed by other browsers. ...
    (comp.lang.javascript)
  • Re: MaintainScrollPosition in masterpage + ajax
    ... javascript included in a div will not fire with an async postback. ... you should attach you scroll code to the PageRequestManagers beginrequest and endrequest events. ... I have a master page. ... Inside that updatePanel I have a tree. ...
    (microsoft.public.dotnet.framework.aspnet)
  • "scrolling buttons"
    ... I would like to make some kind of buttons that can be used to scroll other ... about "scrolling" itself - I generally use MouseMove event, ... the pointer would quickly leave the button's area and i would get no event ... Prev by Date: ...
    (microsoft.public.dotnet.framework)