Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- /**** Fun Stuff that you need to copy into your page ****/
- document.addEventListener("DOMNodeInserted", function () {
- var LEEWAY = 200; // Amount of "leeway" pixels before latching onto the bottom.
- // Some obscene browser shit because making sense is for dweebs
- var b = document.body;
- var offset = b.scrollHeight - b.offsetHeight;
- var scrollPos = (b.scrollTop+offset);
- var scrollBottom = (b.scrollHeight - (b.clientHeight+offset));
- // If we are at the bottom, go to the bottom again.
- if (scrollPos >= scrollBottom - LEEWAY) {
- window.scrollTo(0,document.body.scrollHeight);
- }
- }, false);
- /**** End of the Fun Stuff ****/
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement