Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q875 When using a floating layer, how do I keep the thing invisible when the user is scrolling the page and visible only when the user is not scrolling?

irt.org | Knowledge Base | DHTML | Q875 [ previous next ]

Q875 When using a floating layer, how do I keep the thing invisible when the user is scrolling the page and visible only when the user is not scrolling?

Increase the setTimeout interval:

<head>
<script language="JavaScript"><!--
function pageOffset() {
    if (document.layers) {
        document.layers['parentLayer'].pageX = window.pageXOffset;
        document.layers['parentLayer'].pageY = window.pageYOffset;
    }
    else if (document.all) {
        document.all['parentLayer'].style.left = document.body.scrollLeft;
        document.all['parentLayer'].style.top = document.body.scrollTop;
    }
    setTimeout('pageOffset()',2000); // every 2 seconds
}
//--></script>
</head>

<body onLoad="pageOffset()">

<div id="layerName" left="10" TOP="10">Some content in here</div>

</body>
</html>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.