Change height of iframe on action

At 200 are only displaying part of the page the iframe wraps or it goes to a second page, which is longer?

If the second, can you use 100% instead of a fixed height?
 
Upvote 0

UKSBD

Moderator
  • Dec 30, 2005
    13,026
    1
    2,828
    At 200 are only displaying part of the page the iframe wraps or it goes to a second page, which is longer?
    The content of the iframe is about 1000px but onload only the top 200px of it is used, there is about 800 of white background

    If the second, can you use 100% instead of a fixed height?

    % wont work with the iframe
     
    Upvote 0
    Try one of these:

    <body style="margin:0px;padding:0px;overflow:hidden">
    <iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
    </body>

    or

    <body style="margin:0px;padding:0px;overflow:hidden">
    <iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="100%" width="100%"></iframe>
    </body>
     
    Upvote 0

    UKSBD

    Moderator
  • Dec 30, 2005
    13,026
    1
    2,828
    neither load the frame at a height

    looking at the iframe source, it has different sections for different stages.

    the initial section only needs to be about 200, but the other sections need to be a 1000
     
    Upvote 0

    UKSBD

    Moderator
  • Dec 30, 2005
    13,026
    1
    2,828
    unfortunately no it is not possible to auto-adjust the iframe height. Not unless you have control of the code on both ends - in that case you can add MutationObserver so the iframed page can send data over to the container page and use javascript to adjust the height.

    but its quite complex to pull off and get right.
    Yes, ideally the iframe heights would be determined by the source sections, not something i can do :(

    At least having a darker background behind it makes it more obvious that there is content lower down the page
     
    Upvote 0

    fisicx

    Moderator
    Sep 12, 2006
    46,672
    8
    15,363
    Aldershot
    www.aerin.co.uk
    You can change the height using Js/jquery. I use it a lot on my forms.

    That being said, cliniko is a dreadful bit of software.
     
    Upvote 0
    You can change the height using Js/jquery. I use it a lot on my forms.

    That being said, cliniko is a dreadful bit of software.
    Your missing the point. yes you can change the iframe height with javascript anytime you want! NO PROBLEM :)

    However the container cannot access any information about the internal iframe, ie. there is no way to know the content changed, how heigh the content is or anything else! So for the OP its useless.
     
    • Like
    Reactions: fisicx
    Upvote 0

    Latest Articles