使用微调器加载iframe [英] Load Iframe with spinner

查看:85
本文介绍了使用微调器加载iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码可以正确加载微调器,但是加载完成后如何隐藏它?

This code loads correctly the spinner, but how do I hide it after loading completes?

iframe {
    background-image: url("http://jimpunk.net/Loading/wp-content/uploads/loading2.gif");   
    background-repeat: no-repeat;
    background-position: 50% 50%;
}

推荐答案

作为替代解决方案,您也可以执行以下操作:

As an alternative solution, you can do this as well:

    <div id="spinner">
        <div>
             <img src="http://www.ajaxload.info/images/exemples/25.gif" />    
        </div>
    </div>
    <iframe border=0 name=iframe src="http://www.w3schools.com" width="950" height="633" scrolling="no" noresize frameborder="0" onload="document.getElementById('spinner').style.display='none';"></iframe>

将微调框的绝对位置设置为页面容器的样式,以使其适当居中

Style the position of the spinner absolute to the page container to center it appropriatedly

这篇关于使用微调器加载iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆