Re: How to move scrollbar automatically when i drag an item from top to bottom by mouse?
That only tells the window to scroll.
Since you already have drag and drop capabilities, then you must have access to the mouse coordinates. If the mouse Y coordinate is about to go off the screen, tell the window to scroll up about 50 pixels.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Re: How to move scrollbar automatically when i drag an item from top to bottom by mou
hey thanks for reply, i used like this window.scrollTo(0,5); it always move to top of the page. If i want to move in between the page how can i set the coordinates.
Re: How to move scrollbar automatically when i drag an item from top to bottom by mou
Originally Posted by PeejAvery
The two numbers are the X and Y coordinates of the page. Just specify the coordinates to which you want to scroll.
[Hint: usually relative to some "current" position....]
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!) 2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Re: How to move scrollbar automatically when i drag an item from top to bottom by mou
Originally Posted by PeejAvery
The two numbers are the X and Y coordinates of the page. Just specify the coordinates to which you want to scroll.
Y coordinate every time will changed. i want to move the scroll bar based on the mouse like we scroll the mouse up and down. Like that when i drag the selected element with mouse it should move scrollbar with the mouse.
Re: How to move scrollbar automatically when i drag an item from top to bottom by mou
Originally Posted by TheCPUWizard
[Hint: usually relative to some "current" position....]
Not in JavaScript. It is always from the top of the page. The offset is always controlled by scrolling offset methods.
Originally Posted by adusumalli
Y coordinate every time will changed. i want to move the scroll bar based on the mouse like we scroll the mouse up and down. Like that when i drag the selected element with mouse it should move scrollbar with the mouse.
So why not just track the mouse coordinates and then set the scrollTo accordingly?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Re: How to move scrollbar automatically when i drag an item from top to bottom by mou
Originally Posted by PeejAvery
Not in JavaScript. It is always from the top of the page. The offset is always controlled by scrolling offset methods.
So why not just track the mouse coordinates and then set the scrollTo accordingly?
The parameter to ScrollTo() is always absolute...no disagreement...
HOW those parameters are CALCULATED is usually based on a combintation of the current position and the desired amount of movement (A "relative" value).
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!) 2008, 2009,2010 In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.