網頁彈出窗口代碼全攻略?
1、引用jq和cookie,通過cookie判斷是否首次打開。
2、定義彈出層代碼<div class="advbox"><div class="advpic"><img width="670" height="420" alt="" src="images/xin.jpg"/><a href="javascript:void(0);" class="closebtn">關閉</a></div></div>加入光比代碼;
3、添加css樣式*{margin:0;padding:0;list-style-type:none;}a,img{border:0;text-decoration:none;}body{font:12px/180% Arial, Helvetica, sans-serif,"";}/* advbox */*html,*html body{background-image:url(about:blank);background-attachment:fixed;}*html .advbox{position:absolute;top:expression(eval(document.documentElement.scrollTop));}.advbox{width:670px;position:fixed;display:none;left:50%;top:0;margin:-215px 0 0 -325px;}.advbox .advpic{position:relative;height:420px;overflow:hidden;}.advbox .advpic .closebtn{display:block;width:40px;height:20px;line-height:20px;font-size:12px;color:#fff;text-indent:12px;overflow:hidden;position:absolute;right:5px;top:0px;z-index:99;}