...

View Full Version : Iframe inside another Iframe alternative



joe82
01-25-2006, 11:24 PM
Hi everyone,

I believe that having an iframe inside another iframe is not posssible, so I'm looking for another solution.

I have a main iframe that contains the bulk of my page. I have another iframe that I use to pop up a calendar over it. What I want to do is to move the calendar while the main iframe is scrolling. Because currently, my page moves when I scroll but the calendar stay idle.

Thanks

Joe

GrimChild
01-26-2006, 01:36 AM
Quickly written and untested on netscrap.. but here goes...



<html>

<body>


<div id="calendar" style="position:absolute;left:0;top:0">My Calendar Iframe In Here</div>

<script language=javascript>
function followScroll(){
cal=(document.getElementById)?document.getElementById('calendar'):(document.all)?document.all['calendar']:null;
if(cal){
if(document.all){
cal.style.top=window.document.body.scrollTop;
}
else{
cal.top=window.document.body.window.pageYOffset;
}
}
}
setInterval('followScroll()',20);
</script>

<br><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />

</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum