|
|
|
date: Tue, 25 Sep 2007 14:42:02 -0400,
group: microsoft.public.inetsdk.programming.scripting.jscript
back
Scrolling and dragging
I have a webpage in which the user can drag an element to another location.
If they do not drag it to a valid location, I have the element returned to
it's natural position. On pages which are small enough to fit on one page,
this works fine, but if the user scrolls while dragging or has scrolled
before they start dragging, the element being dragged is offset from the
cursor. Although they can continue dragging the element by moving the mouse,
the onmouseup event is not detected by the element due to the offset, and
therefore they cannot stop dragging it, and more importantly, I cannot
detect whether they have dragged it to a valid location (they can't trigger
the onmouseup because they can't move the mouse over the element). Since
there is no onscroll event or scrollposition property that I know of, I am
not sure what to do. I use the JavaScript event.x/event.y properties and the
CSS position, left, and top properties. Does anybody know how to avoid this
scrolling problem? Thanks. My browser is IE6 on Windows XP Pro SP2.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
date: Tue, 25 Sep 2007 14:42:02 -0400
author: Nathan Sokalski
Re: Scrolling and dragging
I have found the document.body.scrollLeft and document.body.scrollTop
properties, but these do not seem to work with the following DOCTYPE tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Is there something else that I can use instead of document.body.scrollLeft
and document.body.scrollTop? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
"Nathan Sokalski" wrote in message
news:eObw6O6$HHA.4592@TK2MSFTNGP06.phx.gbl...
>I have a webpage in which the user can drag an element to another location.
>If they do not drag it to a valid location, I have the element returned to
>it's natural position. On pages which are small enough to fit on one page,
>this works fine, but if the user scrolls while dragging or has scrolled
>before they start dragging, the element being dragged is offset from the
>cursor. Although they can continue dragging the element by moving the
>mouse, the onmouseup event is not detected by the element due to the
>offset, and therefore they cannot stop dragging it, and more importantly, I
>cannot detect whether they have dragged it to a valid location (they can't
>trigger the onmouseup because they can't move the mouse over the element).
>Since there is no onscroll event or scrollposition property that I know of,
>I am not sure what to do. I use the JavaScript event.x/event.y properties
>and the CSS position, left, and top properties. Does anybody know how to
>avoid this scrolling problem? Thanks. My browser is IE6 on Windows XP Pro
>SP2.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansokalski.com/
>
date: Tue, 25 Sep 2007 16:31:52 -0400
author: Nathan Sokalski
|
|