Preload iframe

£可爱£侵袭症+ 提交于 2019-12-01 07:36:34

With JQuery, you don't need to use iframes. Take a look at the .load() function. http://api.jquery.com/load

i.e.

$('#tempc').load('src/stream.php?stream=1');

To preload a page, just create a hidden div and show it when ready.

var stream2 = $('<div>').load('src/stream.php?stream=2').hide();
$('#tempc').html(stream2.html());

Start by loading the iframe, hook into onLoad on the iframe (this might give you a headache in itself, but a little googling should show you how to make this work well cross browser) and run your animation from this event.

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