Reputation: 1
I'm using a jQuery's scrollTo plugin and I want to scroll a divs under a "mask" horizontally, and that works for me very well, but I don't want to scroll a page vertically (of course smooth scrolling don't want to work with that, there's only a jump like in HTML a few pixels down (according to vertical resolution of monitor, because when whole page is displayed - nothing happens)
How can I disable vertical jump to div?
Update
i found an answer - onclick="return false"
thx for help guys!
Upvotes: 0
Views: 286
Reputation: 19998
If you are not already you should check out the scrollTo jQuery plugin, which provides smooth animations and scrolling of specific elements.
However to me it sounds more like animation of divs rather than scrolling, in which case you would need to animate the absolute position of the div.
If you wish the scroll position to move instantly then use jQuery's scrollTop(200)
in order to change the scroll position of an element.
Upvotes: 1
Reputation: 33678
$('#the_div').scrollLeft($('#the_div').scrollLeft()+300);
Or, using the scrollTo plugin:
$('#the_div').scrollTo('+300', {axis:'x'});
Upvotes: 0