I am using scrollTop to scroll through content div using this
v开发者_开发百科ar container = $('#content');
container.scrollTop(
$('#topic-' + id).offset().top - container.offset().top
);
container.scrollTop(
container.scrollTop() + $('#topic-' + id).offset().top - container.offset().top
);
It works. But the scrolling is hard on the eyes. Is there any way to ease the transistion.
I appreciate any help.
From the jquery API ...
You need to use the scrolltop as a method in the animation. i.e. :
.animate({scrollTop:0}, 2000, 'ease')
精彩评论