+ -
当前位置:首页 → 问答吧 → IFRAME刷新问题,在线等

IFRAME刷新问题,在线等

时间:2010-05-13

来源:互联网


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> *{margin:0;padding:0} </style> </head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript"> function mattewindow(mwidth,mheight,trigname,msrc,m_auto){ var m_str,interval_id = 0; var dom_id = function(o){return document.getElementById(o)} var theWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); var theHeight = Math.max(document.documentElement.clientHeight, document.body.offsetHeight); $("<div id=\"mattebox\" style=\"display:none\"><\/div>").appendTo("body"); m_str = "<style type=\"text/css\">#mattecont{border:3px solid red;position:absolute;z-index:5555;top:0;left:0;}#blackbg{background:#000;position:absolute;top:0;left:0;filter:alpha(opacity=40);opacity:0.4;z-index:22}<\/style>" m_str += "<div id=\"mattecont\">"; m_str += "<iframe id=\"m_iframe\" name=\"ifrmname\" src=\""+msrc+"\" frameborder=\"0\" width=\""+mwidth+"\" height=\""+mheight+"\" scrolling=\"no\"><\/iframe>"; m_str += "dddddddddddd"; m_str += "<\/div>"; m_str += "<div id=\"blackbg\" style=\"width:"+theWidth+"px;height:"+theHeight+"px;\"><\/div>"; if(m_auto==true){ $("#mattebox").html(m_str).show(); } else{ dom_id(trigname).onclick=function(){ $("#mattebox").html(m_str).show(); } } } $(function(){mattewindow("500","500","headshow",'http://www.baidu.com',false);}); </script> <body> <div style="height:2000px;"> <a href="javascript:;" class="matte" id="headshow">修改头像</a> </div> </body> </html>
 提示:您可以先修改部分代码再运行
运行后,请刷新一次再点击   修改头像。

我把m_auto设成true就会自动加载。
改成FALSE启用onclick事件,但是iframe却不显示内容,非要把iframe再刷新一次才会出来页面。

所以想问下有没有iframe自动刷新的代码

在线等~!!!!

[ 本帖最后由 hanmoguoke 于 2010-5-13 16:02 编辑 ]

作者: hanmoguoke   发布时间: 2010-05-13

谁来帮我解决

作者: hanmoguoke   发布时间: 2010-05-13