Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Persistent Layer

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
How do you create a persistent layer that goes to the same spot on the screen even if the user scrolls down?
 
could you give a little more information on this one?
Manic
-----------------------------
I've broken it again !!
-----------------------------
lee.gale@virgin.net
 
Here you go.
Code:
<html>
<head>
<script>
function checkandmove(){
	newtop=fromtop+document.body.scrollTop;
	theDiv.style.top=newtop;
}
function Init(){
	fromtop=parseInt(theDiv.style.top);	// just grab distance from top of div, set in style top
}

</script>
</head>
<body onLoad=&quot;Init();&quot; onScroll=&quot;checkandmove();&quot;>
<div id=&quot;theDiv&quot; style=&quot;position:absolute;left:150;top:50;width:50;height:50;background-color:yellow&quot;>
STAY!
</div>

</body>
</html>
Hope I helped / Thanks for helping
if ((x<10&&y<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){ alert(&quot;I'm a monkey's uncle&quot;); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top