<style> .dialog-overlay { background: #000 none repeat scroll 0 0; display: none; left: 0; min-width: 990px; opacity: 0.6; position: absolute; top: 0; width: 100%; z-index: 1000096; } .new-user { display: none; left: 30%; margin-left: -300px; margin-top: -160px; position: fixed; top: 30%; z-index: 1000097; } .new-user .new-pic { height: 653px; overflow: hidden; width: 1014px; } .new-user img { display: block; height: 653px; width: 1014px; } .new-user .close { position: absolute; right: 0; top: 0; width: 32px; height: 32px; background: url(/images/close.png) no-repeat; // <!..... 括号里路径是图片路径.......> overflow: hidden; cursor: pointer; } </style> <div id="new-user" class="new-user"> <div class="new-pic"> <a name="index3_homepage1_968877808_pic01" href="javascript:void(0);"> <img src="/images/mail20160803.png" alt="致用户的一封信"> // <!..... 括号里路径是图片路径.......> </a> </div> <i class="close"></i> </div> <div id="dialog-overlay" class="dialog-overlay" style="height:6590px;"> <div class="overlay"></div> </div> <!--end--> <script languang="javascript"> $(document).ready(function (){ loadpopup(); $(".close").click(function (){ $("#dialog-overlay").css("display","none"); $("#new-user").css("display","none"); }); }); function openpopup(){ var new_user=document.getElementById('new-user'); var dialog_overlay=document.getElementById('dialog-overlay'); new_user.style.display="block"; dialog_overlay.style.display="block"; } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadpopup(){ if (get_cookie("popped")==""){ openpopup(); var Days = 1; var date=new Date(); date.setTime(date.getTime()+ Days*12*60*60*1000); //设置date为当前时间+1天 document.cookie="popped=yes; expires="+date.toGMTString(); //将date赋值给expires } } </script>
素材下载见文末