首页 > php教程 > php手册 > IE FF OPERA都可用的弹出层

IE FF OPERA都可用的弹出层

WBOY
发布: 2016-06-06 20:01:06
原创
997 人浏览过

var dv; var dvMsg; function customalert() { // var h = document.body.scrollHeight; // var w = document.body.scrollWidth; // dv = document.createElement(div); // dv.setAttribute('id', 'bg'); // dv.style.height = h + px; // dv.style.width =

var dv;
var dvMsg;
function customalert()
{
//   var h = document.body.scrollHeight;
//   var w = document.body.scrollWidth;
//   dv = document.createElement("div");
//   dv.setAttribute('id', 'bg');
//   dv.style.height = h + "px";
//   dv.style.width =  w+ "px";
//   dv.style.zIndex = "1111";
//   dv.style.opacity = 0.3;
//   dv.style.filter = "alpha(opacity=0.3)";
//   dv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=30)"; dv.style.background = "#000";
//   dv.style.position = "absolute";
//   dv.style.top = 0;
//   dv.style.left = 0;
//   document.body.appendChild(dv);
   dvMsg = document.createElement("div");
   dvMsg.style.position = "absolute";
   dvMsg.setAttribute('id', 'msg');
   dvMsg.style.width = "600px";
   dvMsg.style.padding = "10 0 2 0";
   dvMsg.style.height = "313px";
   dvMsg.style.background = "#EF621D";
   dvMsg.style.border = "1px solid #6699dd";
   dvMsg.style.zIndex = "1112";
   document.body.appendChild(dvMsg);
   document.getElementById("msg").style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - document.getElementById("msg").offsetHeight)/2 + "px";
   document.getElementById("msg").style.left = document.documentElement.scrollLeft + (document.documentElement.clientWidth - document.getElementById("msg").offsetWidth)/2 + "px";
   var imgs = document.createElement("div");
   imgs.setAttribute("id", "pic");
   imgs.title = "close";
   imgs.style.float = "left";
   imgs.style.height = "20px";
   imgs.innerHTML = "IE FF OPERA都可用的弹出层";
   imgs.style.color = "#FFF";
   imgs.style.textAlign = "right";
   imgs.style.cursor = "pointer";
   imgs.style.zIndex = "1114";
   imgs.onclick = function()
   {
      document.body.removeChild(dvMsg);
      document.body.removeChild(dv);
   }
   ;
   document.getElementById("msg").appendChild(imgs);
   var divstr = document.createElement("div");
   divstr.setAttribute("id", "info");
   divstr.style.left = "0";
   divstr.style.position = "absolute";
   divstr.style.marginTop = "10px";
   divstr.style.zIndex = "1115";
   divstr.innerHTML = "";
   document.getElementById("msg").appendChild(divstr);
}

//function closeFlash()
//{
// document.body.removeChild(dvMsg);
//      document.body.removeChild(dv);
//   window.open("http://www.com-edu.cn/zhuanti/china60/index.html ");
//}

function scrolldivs()
{
document.getElementById("msg").style.top=document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("msg").offsetHeight)/2+"px";
 document.getElementById("msg").style.left=document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("msg").offsetWidth)/2+"px";
}
 
window.attachEvent("onresize",scrolldivs);
window.onscroll=scrolldivs;
window.onload=scrolldivs;
 //window.addEventListener("resize",scrolldivs(),false);
// window.addEventListener("scroll",scrolldivs(),false);

//setTimeout("closeFlash()",3000);

 

 

id ="nav "> style ="WIDTH: 801px; HEIGHT: 129px " align =left
src =../../images/4.swf width =801 height =129 type =application/x-shockwave-flash wmode ="transparent " menu ="false " quality ="heigh " tybe ="application/x-shockwave-flash ">

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板