简体   繁体   中英

Bizarre behaviour related to iframes

In our project, we dynamically generate pages, and for that we use iframes in iframes. (I know, generally bad idea, but it is a really old project)

The bizarre behaviour is the following:

There is an iframe, which should be hidden, and for that we use display:none; When a specific button is pressed, it should remove this display:none part, and it does it. However, the iframe does not appear. (for other iframes, this behaviour works perfectly)

The bizarre part comes in, when I (in Chrome) search in the Element selection of the development tools for the specific Id for the iframe, (I kid you not) it suddenly appears on the webpage.

Does anyone has any idea why it doesn't appear, and what kind of update the element search does to it to make it appear?

Thanks

setting display: none; will stop browser from loading the iframe's content, even if you later make it display block, then the iframe element will be there but it won't fetch data from network.

try this position: absolute; left: -5000px; or use js to refresh iframe after its set to display block

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM