重新加载iframe而不会闪烁/闪烁(使用Javascript) [英] Reload an iframe without flickering/flash (in Javascript)
本文介绍了重新加载iframe而不会闪烁/闪烁(使用Javascript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想问问是否有人有一个简单的解决方案,可以让我重新加载/刷新iframe,但在重新加载页面时却没有闪烁/闪烁,那有可能吗?也许要先进行动画处理,然后再进行动画处理,而不是闪烁/闪光?我不知道任何输入会有所帮助,
I would like to ask if anyone has a simple solution that will allow me to reload/refresh an iframe but without the flickering/flash when the page reloads, it that possible ? Maybe to animate a blur-out and then a blur-in instead of the flickering/flash? I don't know any input would be helpful,
谢谢.
这是我现在重新加载iframe的方式
Here is how I reload the iframe now
document.getElementById("FrameID").contentDocument.location.reload(true);
感谢您的帮助.
推荐答案
最简单的方法:
- 在DOM外部或隐藏元素中创建新的iframe.
- 将页面加载到隐藏框架内
- 一旦负载甚至在隐藏框架内触发,就将它们交换一下!
交换
要实际交换它们,只需将它们彼此相邻并切换 display:none/block
每个CSS.
To actually swap them, just have them next to each other and toggle the display: none / block
css of each one.
这篇关于重新加载iframe而不会闪烁/闪烁(使用Javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文