星空网 > 软件开发 > Java

Ajax加载外部页面的一个弹出层效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <head>
<title>Ajax加载外部页面的一个弹出层效果</title>
<style>
body {margin:0px}
#Loading {position:absolute;z-index:10;left:10px;top:10px;border:1px #666666 solid;background:#eeeeee;width:10px;height:10px}
.LoadContent {width:100%;height:100%;overflow:auto}
</style>
<script LANGUAGE="JavaScript">
<!--
function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}
var OverH,OverW,ChangeDesc,ChangeH=50,ChangeW=50;
function OpenDiv(_Dw,_Dh,_Desc) {
$("Loading").innerHTML="Loading...";
OverH=_Dh;OverW=_Dw;ChangeDesc=_Desc;
$("Loading").style.display='';
if(_Dw>_Dh){ChangeH=Math.ceil((_Dh-10)/((_Dw-10)/50))}else if(_Dw<_Dh){ChangeW=Math.ceil((_Dw-10)/((_Dh-10)/50))}
$("Loading").style.top=(document.documentElement.clientHeight-10)/2+"px";
$("Loading").style.left=(document.documentElement.clientWidth-10)/2+"px";
OpenNow()
}
var Nw=10,Nh=10;
function OpenNow() {
if (Nw>OverW-ChangeW)ChangeW=2;
if (Nh>OverH-ChangeH)ChangeH=2;
Nw=Nw+ChangeW;Nh=Nh+ChangeH;

if(OverW>Nw||OverH>Nh) {
if(OverW>Nw) {
$("Loading").style.width=Nw+"px";
$("Loading").style.left=(document.documentElement.clientWidth-Nw)/2+"px";
}
if(OverH>Nh) {
$("Loading").style.height=Nh+"px";
$("Loading").style.top=(document.documentElement.clientHeight-Nh)/2+"px"
}
window.setTimeout("OpenNow()",10)
}else{
Nw=10;Nh=10;ChangeH=50;ChangeW=50;
AjaxGet(ChangeDesc)
}
}


//创建function createvar ret = null;
try {ret = new ActiveXObject('Mscatch (e) {
try {ret = new ActiveXObject('Microsoft. catch (ee) {ret = null}
}
if (!ret&&typeof return ret;
}

function AjaxGet(URL) {
var if (if ($("Loading").innerHTML="<div class='LoadContent'>"+}
}
}
//-->
</script>
</head>
<body>
<a href="javascript:OpenDiv(500,300,'index.html')">首页 500*300</a><br><br>
<a href="javascript:OpenDiv(500,200,'index.html')">Test 500*200</a><br><br>
<a href="javascript:OpenDiv(200,500,'l.html')">子页面 200*500</a><br><br>
<div id="Loading" ondblclick="this.style.display='none'"></div>
注意:需加载的文件必须在子目录下,也就是本文件需处于上级才行。页面编码UTF8。
<div>http://www.999jiujiu.com/</div>
</body>
</html>




原标题:Ajax加载外部页面的一个弹出层效果

关键词:ajax

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Shopee新手有问必答!:https://www.ikjzd.com/articles/95756
全面分析:解读我国Q1季度网络零售市场发展态势!:https://www.ikjzd.com/articles/95757
亚马逊产品市场怎样判断?选品思路如何突破?:https://www.ikjzd.com/articles/95759
跨境电商有何优势?亚马逊无货源店铺注册需要什么?:https://www.ikjzd.com/articles/95761
【新手卖家】速卖通如何获得流量和提升转化率:https://www.ikjzd.com/articles/95766
新手卖家避免踩雷,亚马逊无货源模式应该如何运营?:https://www.ikjzd.com/articles/95768
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
石象湖景区门票-石象湖景区门票优惠政策:https://www.vstour.cn/a/411243.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流