Things to do in Cape Town, the Helderberg, and the Cape Winelands

Tag scrollTo

How to Scroll to the Top of a Page with Plain Old Javascript

Plain old vanilla Javascript comes equipped with two really handy functions, namely scrollBy(dx,dy) which allows you to scroll a window by the specified number of pixels and scrollTo(x,y) which forces a window to scroll to the specified co-ordinates, with the specified point referring to the top left corner of the window.

jQuery: Scroll to the Top of a Page

My current project requires me to split up a particularly long survey into chunks, allowing a survey taker to only submit those chunks that he/she feels like submitting and ignoring the rest.

© 2021 An Exploring South African — Powered by WordPress