I am using scrollTop to scroll through content div using this
var 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. ie :
.animate({scrollTop:0}, 2000, 'ease')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.