Skip to content

24 ways to impress your friends

Vote down?

Michael Kjeldsen

Quite brilliant (and short) script for this behaviour – which I have never even noticed :-)

Two questions:
Since Android’s using the window.scrollTo(0,1) couldn’t you just add 1 unused pixels at the very top? I know it’s technically a waste of space, but 1px versus extra JS seems to me to be a fair exchange?

Also: How can this particular script be rewritten to take into account the user’s last position on the page? Rudie mentions it and you refer to jQuery Mobile UI – but what about those of us that do not use jQuery Mobile UI for development?

I’m no expert at javascript – I’m not even a beginner – so I hope that you’ll update this script accordingly :-)

/michael