Iframes in firefox not updating when hidden

孤街醉人 提交于 2019-12-25 04:21:04

问题


I'm having troubles with a page that display a slideshow using the jquery.cycle2 plugin. The "slides" are actually divs containing Iframes that the plugin will show as a slideshow.

The problem is that the Firefox and Chrome will pre-load the iframes and then show a cached version of the Iframe which in my case is not acceptable since these Iframes are showing data from reports that need to be up-to-date.

Weirdly enough Internet Explorer reloads the Iframe each time the slideshow plugin changes the visibility of the dom-element so in my case It works as expected : Every time an Iframe is visible the content of the IFrame is refreshed.

I have tried a lot of things using JavaScript in Chrome and Firefox to refresh the IFrame when it's hidden, but the browser will not refresh the Iframe or the Iframe content will be broken.

I can refresh the Iframe when its visible but this causes a nasty white flash when the IFrame reloads.

My question is : Can I force Chrome/Firefox to refresh an Iframe when it's hidden? if so how?

I'm using :

  • IE 11
  • Firefox 26
  • Chrome 32

Also weirdly on some older versions of firefox (like 3.x) this works as expected

Thanks in advance

来源:https://stackoverflow.com/questions/21452625/iframes-in-firefox-not-updating-when-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!