欢迎光临
我们一直在努力

popup的两种方法-ASP教程,ASP应用

建站超值云服务器,限时71元/月

1,popup

var pop;

function window.onload() { document.all .emeng.style.display=none; window.settimeout(aaa,5000); } function aaa() { var div=document.all .emeng; var body=document.body; pop=window.createpopup(); // html=div.innerhtml; html=" ssss open

"; pop.document.body.innerhtml=html; pop.document.body.style.border="solid 1px"; //pop.document.body.style.bgcolor="#efefeb"; divtop = parseint(div.style.top,10); divleft = parseint(div.style.left,10); divheight = parseint(div.offsetheight,10); divwidth = parseint(div.offsetwidth,10); docwidth = body.clientwidth; docheight =body.clientheight; y = parseint(body.scrolltop,10) + docheight + 10;// divheight x = parseint(body.scrollleft,10) + docwidth – divwidth; pop.show(x, y, 180, 116, null); } function closediv() { window.alert(sss); }

2,div

var divtop,divleft,divwidth,divheight,docheight,docwidth,objtimer,i = 0; var div=document.getelementbyid("emeng"); var body=document.body ; function getmsg() { //window.parent.frames["topmusic"].location.href = "top.asp" try{ divtop = parseint(div.style.top,10); divleft = parseint(div.style.left,10); divheight = parseint(div.offsetheight,10); divwidth = parseint(div.offsetwidth,10); docwidth = body.clientwidth; docheight = body.clientheight; div.style.top = parseint(body.scrolltop,10) + docheight + 10;// divheight div.style.left = parseint(body.scrollleft,10) + docwidth – divwidth; div.style.visibility="visible"; objtimer = window.setinterval("movediv()",10); } catch(e){} } function resizediv() { i+=1; if(i>888) closediv(); try{ divheight = parseint(div.offsetheight,10); divwidth = parseint(div.offsetwidth,10); docwidth = body.clientwidth; docheight = body.clientheight; div.style.top = docheight – divheight + parseint(body.scrolltop,10); div.style.left = docwidth – divwidth + parseint(body.scrollleft,10); } catch(e){} } function movediv() { try { if(parseint(div.style.top,10) <= (docheight – divheight + parseint(body.scrolltop,10))) { window.clearinterval(objtimer); objtimer = window.setinterval("resizediv()",1); } divtop = parseint(div.style.top,10); div.style.top = divtop – 1; } catch(e){} } function closediv() { div.style.visibility=hidden; if(objtimer) window.clearinterval(objtimer); } window.onload = getmsg; window.onresize = resizediv; window.onerror = function(){}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » popup的两种方法-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章