Mega Code Archive

 
Categories / JavaScript DHTML / Window Browser
 

Preventing a Page from Scrolling

<html>  <head>  <title>onscroll Event Handler</title>  <script type="text/javascript">  window.onscroll = zipBack;  function zipBack() {  window.scroll(0,0);  }  </script>  </head>  <body>  <h1>onscroll Event Handler</h1>  <hr />  This page always zips back to the top if you try to scroll it.  <p><iframe frameborder="0" scrolling="no" height="1000"  src="bofright.htm"></iframe></p>  </body>  </html>