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
https://forums.phpfreaks.com/topic/223152-internet-explorer-scrollto-bug/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.