Js用一个简单的弹出层div来在页面中间显示一个具体的掩码。
这两天是用来练你的手的,比预想的要遇到的问题还多,比如:IE6背景透明的IE6中心显示和JS对象的理解
OpenID =显示按钮,div,这closeid =关闭按钮,conid =需要显示
解决办法是:
1。可以在IE6块选择的元素,但DIV不够透明在IE6
2。弹出div始终可以显示在浏览器屏幕的中间。
问题:
1。目前不支持类只支持# ID。
2。需要显示的div需要设置CSS本身。
三.你需要设置CSS在IE6
例如,div { _position:绝对的;_top:表达(documentelement.scrolltop + 340 +PX);}
这里4.ie6背景DIV不是透明的,结果我在网上搜索不能解决方案如果你有办法请留言给我
复制代码代码如下所示:
Js制作了一个简单的弹出层div来在页面中间显示掩码。
*边距:0;填充:0;}
# BT {边界:2px固体# 000;背景颜色:# CCC;鼠标指针;填充:2px 5px;}
*****弹出框
。ordermsg {位置:固定;_position:绝对的;_top:表达(documentelement.scrolltop + 340 +PX);背景:# FFF边境:1px;固体# 939395;宽度:500px;身高:340px;最高:50%;左:50%保证金:00;- 200px 250px;溢出:隐藏;Z指数:99999;字体大小:14px;颜色:# 000;显示:无;}
。ordermsg DL {溢出:隐藏;padding: 20px;保证金:0;}
。ordermsg DL DT {线高度:30px;}
。ordermsg DL DD {线高度:25px;身高:25px;填充左:10px;保证金:0;}
。ordermsg DL DD标签{填充左:5px;}
。ordermsg DL dd.cbtn {宽度:102px;身高:28px;背景:URL(。 / / / choosebtn成员图像,GIF)没有重复;边距:10px;填充:0;}
。ordermsg DL dd.cbtn一{显示:块;文本对齐:中心;}
。ordermsg DL dd.cbtn:链接。ordermsg DL dd.cbtn:参观{颜色:# 000;}
。ordermsg DL dd.lbtn {浮动:左;显示:内联;margin-left: 100px;}
。ordermsg DL dd.rbtn {浮动:左;显示:内联;margin-left: 10px;}
点击了DIV
sdfdsf
沃尔沃
萨博
梅赛德斯
奥迪
点击了DIV
sdfdsf
沃尔沃
萨博
梅赛德斯
奥迪
请把订单取消的原因告诉我们,以便我们改进。非常感谢。
改变主意,我现在不想买。
刚才资料已填好了。
取消、更换或添加新货物
网上银、信用卡等支付存在问题。
等待的时间太长了,不耐烦了。
商品的价格比较贵。
商品短缺
其他原因
自动取消72小时到期(不是可选的)
选择单击取消
*
OpenID =显示按钮,div,这closeid =关闭按钮,conid =需要显示
解决办法是:
1。可以在IE6块选择的元素,但DIV不够透明在IE6
2。弹出div始终可以显示在浏览器屏幕的中间。
问题:
1。目前不支持类只支持# ID。
2。需要显示的div需要设置CSS本身。
三.你需要设置CSS在IE6
例如,div { _position:绝对的;_top:表达(documentelement.scrolltop + 340 +PX);}
这里4.ie6背景DIV不是透明的,结果我在网上搜索不能解决方案如果你有办法请留言给我
* /
无功_calf = { / /方便的方法
$:功能(ID){ return document.getelementbyid(ID)},
创建:功能(ID){ return document.createelement(ID)},
附加:功能(ID){ return document.body.appendchild(ID)},
删除:功能(ID){ return document.body.removechild(ID)}
}
功能弹出(OpenID,conid,closeid){
This.onclick(OpenID,conid,closeid);
}
popup.prototype = { {
CSS样式:宽度:100%;位置:绝对;左:0;最高:0;过滤器:α(不透明度50);不透明度:0.5;边境:0;溢出:汽车;
CreateShadowDiv:函数(){ / /背景遮罩
无功shadowdiv = _calf.create(div);
shadowdiv.id =shadowdiv ;
shadowdiv.style.csstext = this.cssstyle;
shadowdiv.style.height = document.body.scrollheight +PX;
shadowdiv.style.backgroundcolor =# 000
shadowdiv.style.zindex = 100;
_calf.append(shadowdiv);
},
CreateIframe:函数(){ / / IFRAME
VaR IFRAME = _calf.create(iframe);
iframe.id =shadowiframe ;
iframe.style.csstext = this.cssstyle;
iframe.style.height = document.body.scrollheight +PX;
iframe.style.zindex = 99;
_calf.append(iframe);
},
RemoveDiv:函数(){
_calf.remove(_calf。$(shadowdiv ));
_calf.remove(_calf。$(shadowiframe ));
},
Onclick:功能(OpenID,conid,closeid){
var =;
_calf。$(OpenID)。Onclick =函数(){
如果(窗口。ActiveX对象){ / / IE6
如果(!窗口。XMLHttpRequest){
document.body.style.csstext =_background-image:URL(约:空白);_background-attachment:固定;;
}
}
that.createiframe();
That.createShadowDiv();
_calf。$(conid)。style.display =块;
}
document.getelementbyid(closeid)。Onclick =函数(){
_calf。$(conid)。style.display =没有;
That.removeDiv();
}
}
}
新的弹出窗口()