下面是一个js控制的弹出框但是没有弹出框淡入淡出的效果,请大神帮助 帮我写个淡入淡出的效果,谢谢
<body><!--首先设置一个层:--><divid="pop"class="pop"style="display:none"><divclass="pop_head"...
<body><!--首先设置一个层:--><div id="pop" class="pop" style="display:none"> <div class="pop_head"><a class="close" href="javascript:void(0);" onclick="hide()"></a></div> <div class="pop_body"><img src="btn.jpg" width="300" height="300" alt="" /></div></div><!--弹出层的按钮:--> <a href="javascript:void(0);" onclick="show();"><img src="btn.jpg" width="100" height="100" alt="" /></a> <script type="text/javascript"> var EX = { addEvent:function(k,v){ var me = this; if(me.addEventListener) me.addEventListener(k, v, false); else if(me.attachEvent) me.attachEvent("on" + k, v); else me["on" + k] = v; }, removeEvent:function(k,v){ var me = this; if(me.removeEventListener) me.removeEventListener(k, v, false); else if(me.detachEvent) me.detachEvent("on" + k, v); else me["on" + k] = null; }, stop:function(evt){ evt = evt || window.event; evt.stopPropagation?evt.stopPropagation():evt.cancelBubble=true; }};document.getElementById('pop').onclick = EX.stop;var url = '#'; function show(){ var o = document.getElementById('pop'); o.style.display = ""; setTimeout(function(){ EX.addEvent.call(document,'click',hide); });}function hide(){ var o = document.getElementById('pop'); o.style.display = "none"; EX.removeEvent.call(document,'click',hide);} </script></body>
不要意思样式没法加进来
QQ:651841877@qq.com 谢谢 展开
不要意思样式没法加进来
QQ:651841877@qq.com 谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询