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 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    variable height of an iframe based on top and bottom locations

    Hey, this works in firefox, but not IE - I was wondering if anyone knows of an alternative. I have an iframe that i want to position say 100px from the top and 50px from the bottom of the page, if put top:100px; bottom:50px; height:*; it works fine in firefox but IE doesn't seem to recognize * as a valid value for height. is there something else i can do? I also tried 100% hoping it would just use up "100% of it's available space" but it lines up with the top and then goes beyond the bottom of the page.

    you can see the site in question at www.mzcontrols.com

    thanks!

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    hmm

    okay, i figured out one way to do it, but if you resize the window the frame doesn't resize unless you hit refresh because it's javascript that determines the height upon loading..

    i used code from this post:
    http://www.codingforums.com/showthread.php?t=10886

    but changed frmname.document.body.scrollHeight+20 to

    parent.document.body.scrollHeight-166

    so it's basically 100% minus the height of my header and footer. though i'd still like a better way, that will resize with the window if the browser is resized.. anyone?

    thanks in advance...

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You can use the onresize event to run the javascript without refreshing the page.

  • #4
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    brilliant, thank you!

  • #5
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    works great in IE and Firefox, but doesn't work in Opera, any idea why?


  •  

    Posting Permissions

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