user541686
user541686

Reputation: 210705

Page down with Javascript/jQuery?

How do I perform a "page down" operation with Javascript/jQuery so that it works correctly if the user has zoomed in/out?

i.e. it should scroll no more and no less than would happen if the user had actually pressed the key, whether or not the user had messed up the zoom settings or fonts or DPI or whatever.

Notes:

Upvotes: 1

Views: 3033

Answers (1)

Trey
Trey

Reputation: 5520

$(document).scrollTop($(document).scrollTop()+$(window).height());

EDIT: as per your comment

I'm not able to trigger the native page down functionality with javascript, and since we can't assume that every browser and every operating system will handle pagedown to the exact same number of pixels, I suppose that means you can't do it.

Upvotes: 5

Related Questions