How do you scroll to a pixel number of window height, without such plugins like fullPage.js, onePage.js?
Asked
Active
Viewed 54 times
-2
-
1Possible duplicate of [jQuery Scroll To bottom of the page](http://stackoverflow.com/questions/4249353/jquery-scroll-to-bottom-of-the-page) – Teleeg Jun 12 '16 at 19:29
1 Answers
0
Using plain Jquery:
$(window).scrollTop($(window).scrollTop()+$(window).height());
This just takes the current amount that the page is scrolled down (in pixels) and adds the height of the window to it.
You might want to check out this StackOverflow question on Jquery scrolling and this Jquery documentation article on $.height()
, which talk about each component of this.
Good luck!

Laef
- 1,086
- 2
- 11
- 27
-
It scrolls the page to mentioned size after it (page) loads, but on mousewheel the scrolling is like usual.. See the fiddle https://jsfiddle.net/kgdtzktL/ – EvoMedia Jun 15 '16 at 11:31
-
@EvoMedia Your question was about how to scroll to 100% of page height, not how to do it on a particular event. It's up to you to decide what to do with the code I gave you, from inserting it in an event handler to just doing it on page start. – Laef Jun 15 '16 at 14:37
-
@EvoMedia Look into onscroll functions in Jquery or JavaScript. You can use the code above as the code to be executed onscroll. Good luck! – Laef Jun 15 '16 at 14:38