Dynamically Resizing an Iframe

前端 未结 3 1812
闹比i
闹比i 2021-01-03 07:54

I can see that this question has been asked several times, but none of the proposed solutions seem to work for the site I am building, so I am reopening the thread. I am at

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 08:44

    you moved the handler? maybe you should move the function to the inner frame as well, so that when you grab height values you reference the body directly rather than frame object... then call a parent.set height function

    another trick, call function after settimeout of 10 msecs

    i remember I had that problem once but I used IE's getBoundingClientRect() to get height of content, check mozilla developer center for something similar, this is just a hint, i did not research it

    on another note, what is ifmBluePill? is it the iframe? or a div inside of it? why do you reference "contentDocument" of a div?

提交回复
热议问题