Hi guys! Im looking for a bit of code that will: when people scroll down the page, bring the page straight back to the top. Ie, people can try to scroll down but cant. Any ideas? Notting
this can be done if they click on a link(that has to be fixed somewhere) that link should point to an anchor point at the top of the page. but i dunno how it can be done without clicking. hope this interests you.
So if they hold the scrollbar down they can see stuff down the page, but if they let go, it snaps them back up to the top? I guess I can see some value in that. Sneaky.
Not that I'm condoning this type of behavior, but the following script will do the trick (I can't think of any way to do this other than JavaScript, which can be disabled). <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> function jump() { window.location = "#top"; } document.onmousemove = jump; </script> </head> <body> <a name="top"></a> <!-- All your content goes after the <a name> tag --> </body> </html> Code (markup): The script itself and the <a name="top"></a> parts are the only important pieces.
I gotta say I wouldn't be staying too long as a visitor on a site with that sorta thing going on, think about that.... Most ppl will just think this page is broken and never come back.....
This trick not always work: you can scroll down the page with the "down" key (without moving mouse of course). A better trick is using a timer that several times a second executes function jump(). And instead of window.location = "#top"; Code (markup): you can use window.scroll(0,0); Code (markup): or wherever position you want. Using window.scroll(x,y) with different values for x and y each time your visitor will go crazy