admin管理员组文章数量:1410674
I am resizing an iframe, and when I do that in Firefox, the content gets refreshed.
I have a swf that extends, and in Firefox when the iframe extends to acmodate the swf, the swf appears in its normal position.
In IE this doesn't happen.
Anyone know how to prevent the refresh from happening in Firefox?
Thanks
Edit:
Ok I think the page is not being refreshed just the swf please check this out at:
.html
You can see that when the re-dimensioning takes place there is a quick "flash", in Firefox 3 and the swf returns to its initial state (not expanded), this does not happen in IE.
The code is all client side so you can view it all if you look at the source of the pages.
I am resizing an iframe, and when I do that in Firefox, the content gets refreshed.
I have a swf that extends, and in Firefox when the iframe extends to acmodate the swf, the swf appears in its normal position.
In IE this doesn't happen.
Anyone know how to prevent the refresh from happening in Firefox?
Thanks
Edit:
Ok I think the page is not being refreshed just the swf please check this out at:
http://antoniocs/iframe/index_.html
You can see that when the re-dimensioning takes place there is a quick "flash", in Firefox 3 and the swf returns to its initial state (not expanded), this does not happen in IE.
The code is all client side so you can view it all if you look at the source of the pages.
Share Improve this question edited Jan 27, 2009 at 19:18 mmcdole 93k61 gold badges188 silver badges224 bronze badges asked Jan 21, 2009 at 17:30 AntonioCSAntonioCS 8,51618 gold badges67 silver badges95 bronze badges 2- Example page URL to demonstrate what you mean, please. Resizing should not in general reload any content - unless you're including an incredibly old and shonky Netscape 4 bugfix script, which I should hope you're not in this day and age. – bobince Commented Jan 21, 2009 at 17:44
- Here is the test page -> antoniocs/iframe/index_.html – AntonioCS Commented Jan 22, 2009 at 12:11
4 Answers
Reset to default 4 +200Antonio, I'm afraid that the problem is in Firefox it self. When Gecko detects a change to the width of an iFrame, it repaints the page and causes that "refresh." There's no way that I know of to change this behavior, short of using a different technique.
I confirmed that the problem exists in other Gecko-based browsers as well (specifically Camino and Flock). I was not able to duplicate it in WebKit-based browsers (Chrome and Safari).
It seems to be that either setting position: absolute;
or .cssText
will refresh the frame.
The solution is to add style="position: absolute;"
to your <iframe>
and set your css like this:
this.mrec_div_idObj.style.left = ((offsetLeftIframe) - (dimX - disX)) + "px";
this.mrec_div_idObj.style.top = (offsetTopDiv - disY) + "px";
this.mrec_div_idObj.style.zIndex = 99999999;
this.mrec_div_idObj.style.margin = 0;
this.mrec_div_idObj.style.padding = 0;
I've tested this and it works in Firefox 3.
There is no onresize code.
It's simple! I have an iframe with width 300 and height 250 and when I change them to 500 and 400 firefox refreshes the content and I want to prevent that.
Here is a page where you can see the code -> http://antoniocs/iframe/index_.html
The code to re size the iframe runs after 3 seconds and you can see the the swf, if it was extended, appears in it's initial (not extended) form.
To extend the swf just hover the mouse over it.
In ie there is no refresh in the iframe.
本文标签: javascriptHow do I prevent a swf from refreshing when an iframe is resizedStack Overflow
版权声明:本文标题:javascript - How do I prevent a swf from refreshing when an iframe is resized? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744989861a2636317.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论