Javascript 如何通过加载图像显示刷新Iframe url

Javascript 如何通过加载图像显示刷新Iframe url,javascript,html,iframe,javascript-events,Javascript,Html,Iframe,Javascript Events,我想动画的I帧加载其源页面。我通过使用如下JavaScript代码部分实现了我的目标 function reloadIt() { frm=document.getElementsByName("pagers")[0]; //we get the iframe object frm.src=frm.src; //or you can set the src to a new src setTimeout("reloadIt()",100000);

我想动画的I帧加载其源页面。我通过使用如下JavaScript代码部分实现了我的目标

function reloadIt()
{
    frm=document.getElementsByName("pagers")[0];      //we get the iframe object
    frm.src=frm.src;        //or you can set the src to a new src
    setTimeout("reloadIt()",100000);         //the function will run every 60000 miliseconds, or 60 seconds
}
我的HTMl主体代码在这里

<body onload="reloadIt()">

我的IFRAME代码是这样的

<div id="divLoading">
    <div style="width:100%; height:200px; align="center"> 
        <img src="loader.gif" alt="" align="absmiddle"/> 
    </div>
</div>
<div id="divFrameHolder" style="display:none">
    <iframe  src="lead.php" height="450px;" width="100%"  name="pagers"  onload="hideLoading()" > </iframe>`
</div>


你可以看看BlockUi,一个jquery插件。(http://jquery.malsup.com/block/#element). 试着这样做:

function reloadIt() {
       $("#iframeholder").block({
            message: '<img src="css/ajax-loader.gif"/>',
            css: { width: "600px;", height: "400px;" }
        });
        $('#pagers').attr('src', $('#pagers').attr("src"));
        $('#iframeholder').unblock()
        setTimeout("reloadIt()", 5000);
}
函数重载(){
$(“#iframeholder”).block({
消息:“”,
css:{宽度:“600px;”,高度:“400px;”}
});
$('寻呼机').attr('src',$('寻呼机').attr('src');
$('#iframeholder').unblock()
setTimeout(“reloadIt()”,5000);
}