开发者

JS Iframe loader

I'm looking for a way to use jQuery/js to show a 'Load开发者_JAVA技巧ing...' message while an iframe is loading, when the iframe finished to load completely, the 'Loading...' text should disappear.

Is that possible with jquery/js?

Note: I do not have any control on the website within the iframe.


<script>
function hide() {
  document.getElementById('loading').style.display='none';
}
</script>
<iframe onLoad="hide()" ... ></iframe>
<div id="loading">Please wait</div>

jquery:

$("iframe").load(function() { $("#loading").toggle()});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜