• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

popup的两种方法

发布: 2007-6-30 18:56 | 作者: admin | 来源: | 查看: 12次 | 进入软件测试论坛讨论

领测软件测试网 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(){}



延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网