Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Iframe inside another Iframe alternative

    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

  • #2
    New Coder
    Join Date
    Oct 2002
    Location
    Buffalo, NY
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Try this

    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •