This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes question regarding prevent default Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "question regarding prevent default" Watch "question regarding prevent default" New topic

question regarding prevent default

simon tiberius

Joined: Oct 30, 2012
Posts: 29

but when moving the scrollbar, the page still moves. how to stop the default behavior? thanks
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You can not cancel the scrolling of the page.

You can force the window to be at a certain location, by setting scrollTop inside of that function, but it will be jittery.

I agree. Here's the link:
subject: question regarding prevent default
jQuery in Action, 3rd edition