0

I have two or more iframe on the same page. I have to load all iframe at once and appear in same time. Currently it loaded one by one. I want to load all at once and asynchronous with page loading.

4

2 回答 2

1

我的解决方案:

  • 首先将隐藏的 css 添加到所有 iframe 中。
  • 然后在每个 iframe 上使用 onload 方法。例如,此方法将添加一些类loaded并检查完成是否所有 iframe 都具有此类。
  • 如果没有 - 什么也不做,否则显示所有 iframe。

在这里您可以找到使用 onload 方法的示例:demo

于 2013-05-29T04:24:31.450 回答
0

我认为此链接将对您有很大帮助。这是对 iframe 技术和性能问题的详细解释,可能正是您所寻找的。如上面的答案和此处的链接中所述,您将需要 onLoad 函数调用。

于 2013-05-29T04:27:16.887 回答