1

I want to load a seperate website (eg. a wikipedia article) in an iframe on a web page. The Iframe is not visible until the user clicks a "show" button, but when he does the whole page freezes a second or two until the iframe comes up. Is it possible to load the iframe in the background without the site freezing up, and if Not, then how can you show a loading gif while the iframe loads?

4

1 回答 1

2

这是因为 iframe 加载会阻止浏览器上的某些线程。
你可以在这里阅读更多信息:http: //www.stevesouders.com/blog/2009/06/03/using-iframes-sparingly

这里有一些异步加载 iframe 的技术:http ://www.aaronpeters.nl/blog/iframe-loading-techniques-performance

于 2013-08-25T11:44:02.880 回答