Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
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

Re: Scrolling and dragging   
Nathan Sokalski  wrote:
> 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.

http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_frm/thread/fa3452e1bbb6bcf5

-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Tue, 25 Sep 2007 16:41:25 -0400   author:   Igor Tandetnik

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us