- 積分
- 5068
- 威望
- 5068
- 金錢
- 2878
- 最後登錄
- 2024-11-27
|
代码来源:互联网
图片预览:
新建页头通栏广告,把代码放进去即可。
- <div id="topwarning_7ree" style='margin: 0 auto; border: 1px solid #FF0000; background-color:#FFFF00; clear: both; height: 40px; width:958px; position: relative; display:none;'>
- <div style='position: absolute; right: 3px; top: 3px;'>
- <a href="javascript:void(0);" onClick="hdMsg()"><img src="http://fc01.deviantart.net/fs70/f/2013/129/1/c/close_7ree_by_bjwujie-d64n3rz.gif" border="0" mce_style="border: none;" alt='关闭提示' /></a>
- </div>
- <div style="background-image:url('http://fc05.deviantart.net/fs70/f/2013/129/b/e/warning_7ree_by_bjwujie-d64n3oa.png'); background-repeat:no-repeat; background-position:30px 3px;">
- <div style="margin-left:75px; width:860px;text-align:left; height:40px; line-height:40px;overflow-x :hidden;overflow-y:hidden;">
- <a href="要打开的连接1" style="font-size:13px; color: #FF0000;">警告的内容1</a>
- <a href="要打开的连接2" style="font-size:13px; color: #FF0000;">警告的内容2</a>
- </div></div></div>
- <script type="text/javascript">
- function SetCookie(name,value,Days){
- var exp = new Date();
- exp.setTime(exp.getTime() + Days*24*60*60*1000);
- document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
- }
- function getCookie(name)
- {
- var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
- if(arr != null) return unescape(arr[2]); return null;
- }
- function hdMsg()
- {
- var p1=document.getElementById("topwarning_7ree");
- p1.style.display="none";
- SetCookie('topwarning_7ree', 'off', 1);
- }
- if ('off' != getCookie('topwarning_7ree'))
- {
- document.getElementById("topwarning_7ree").style.display='block';
- }
- </script>
複製代碼
SetCookie('topwarning_7ree', 'off', 1);
这里为关闭警告信息后不再出现的天数,默认为1天。 |
-
1
評分人數
-
|