So im using the window.scrollby like this
<script>
function scrollWindowup() {
window.scrollBy(0,700)
}
function scrollWindowdown() {
window.scrollBy(0,-700) }
</script>
is there any way to animate it like move slowy or an offset or any other option ?
thanks in advance
So im using the window.scrollby like this
<script>
function scrollWindowup() {
window.scrollBy(0,700)
}
function scrollWindowdown() {
window.scrollBy(0,-700) }
</script>
is there any way to animate it like move slowy or an offset or any other option ?
thanks in advance
Share Improve this question edited Oct 16, 2012 at 7:02 user1749105 asked Oct 16, 2012 at 6:15 user1749105user1749105 971 gold badge2 silver badges8 bronze badges1 Answer
Reset to default 15From a similar question...
You can animate the scrolltop
of the page with jQuery
.
$('html, body').animate({
scrollTop: $(".middle").offset().top
}, 2000);
Or
$('html, body').animate({
scrollTop: 700
}, 2000);
Animating down a page:
$('html, body').animate({
scrollTop: '+=700'
}, 2000);
Animating up a page:
$('html, body').animate({
scrollTop: '-=700'
}, 2000);
See this site: http://papermashup./jquery-page-scrolling/