Jump to content

internet explorer scrollto bug


scuff

Recommended Posts

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.