scuff Posted January 1, 2011 Share Posted January 1, 2011 javascript.js function page2() { intervalID = window.setInterval(page2scroll, 15); } var dist = 0; function page2scroll() { dist += 10; window.scrollTo(dist, 0); if (dist>1440) { clearinterval(intervalID); } } index.phtml <html> <head> <script src="javascripts.js" type="text/javascript"></script> <link rel="stylesheet" href="formats.css" type="text/css"> </head> <body id="bodyid"> <div class="page1"> Hello <br> <a href="list.php">List all files in directory?</a> <a onclick="page2();" href="javascript:void(0);">2nd page?</a> </div> <div class="page2"> page 2 </div> </body> </html> When you click on <a onclick="page2();" href="javascript:void(0);">2nd page?</a> it is supposed to make your browser scroll over to another part of the site. It works wonderfully in firefox, chrome but not IE (v 7). I've looked up workarounds but none seem to work can anyone get this to work in ie? The problem in the javascript lies in window.scrollTo(dist, 0);. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.