简体   繁体   中英

iFrame Resize Based On “Change Source” Button?

I've got a weird iFrame situation. I have a search button that, when clicked, changes the source/URL of the iFrame below it based on the value of its form's values. That part works nicely, but I can't seem to get the height to adjust properly! The width of the iFrame's content will always be exactly the same, so that's not a problem, but the height isn't changing automatically based on the frame's dynamic content :( Does anyone know how/if this can be resolved (not fixed... haha)? Is an iFrame not the right thing to use for something like this? IE6 support is unfortunately a priority... Thanks for any help you can give, I appreciate it!

尝试将iframe的高度设置为100%。例如:,或仅在iframe中编写一些javascript,以根据内容更改来调整iframe的大小

http://sonspring.com/journal/jquery-iframe-sizing

This is exactly what I was looking for! I'm surprised this wasn't easier to find...

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