p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript (http://p2p.wrox.com/forumdisplay.php?f=85)
-   -   need help on this JS error code in IE (http://p2p.wrox.com/showthread.php?t=65839)

kumiko February 11th, 2008 11:08 PM

need help on this JS error code in IE
 
window.onscroll = self.setTimeout("self.placeIt('layer1')",500);

window.onscroll has an error in internet explorer 6
"Not implemented"

it works fine in firefox

How can I resolve this?

thanks



joefawcett February 12th, 2008 04:14 AM

Can you provide a small sample page to demonstrate, I have used this event many times?

--

Joe (Microsoft MVP - XML)

joefawcett February 12th, 2008 04:35 AM

After a little experimenting I think the problem is your use of setTimeout. If you move that into a separate function then it works:
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>OnScroll Test</title>
<style type="text/css">
</style>
<script type="text/javascript">

function showScroll(x, y)
{
  var oOutput = document.getElementById("divOutput");
  oOutput.innerHTML += "screenX: " + x + ", screenY: " + y + "<br />";
}

function delayShowScroll()
{
  setTimeout("showScroll(" + event.screenX + ", " + event.screenY + ")", 1000);
}

window.onscroll = delayShowScroll;
</script>
</head>

<body>
<div id="divOutput" style="border: 2px solid #c0c0c0; height: 600px; width: 200px; position: relative"></div>
</body>
</html>

--

Joe (Microsoft MVP - XML)


All times are GMT -4. The time now is 08:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.