Javascript通知栏 - 每天只显示一次?

时间:2012-02-05 07:43:33

标签: javascript cookies

我的博客底部有一个通知栏,我想每天只出现一次。我该怎么写一个cookie呢?这是脚本的代码:

<style type='text/css'>
#ut-sticky
{
background:url(&#39;http://3.bp.blogspot.com/-7oGSlq30cTw/Tv33CS4WGgI/AAAAAAAAA0w/HxId_tRUae8/s1600/ut-bg.png&#39;) repeat; 
color:#fff;
text-align: center;
margin:0 auto; 
border-top: 1px solid #fff;
height:64px; 
font-size:13px; 
position:fixed; 
bottom:0; 
z-index:999; 
width:95%;
border-top-left-radius:15px;
border-top-right-radius:15px; 
display:block;
font-weight: bold;
font-family: arial,&quot;Helvetica&quot;;
font-color:#fff;
}
#ut-sticky:hover
{background:#333;}
#ut-sticky p{line-height:5px; font-size:18px; text-align:center; width:95%; float:left;}
#ut-sticky p a{font-size:18px; font-weight:bold; font-family:&quot;Arial&quot;; color:#cfe7d1;}
.ut-cross{display:block; position:relative; right:15px; float:right;}
.ut-cross a{font-size:18px; font-weight:bold; font-family:&quot;Arial&quot;; color:#cfe7d1; line-height:30px;}
</style>
<div id='ut-sticky'>
<p><a href='http://bit.ly/yq10RE' target='_blank'>Use Google Reader? Why not add www.BenjerMcVeigh.com to your Google Reader list?</a>&#160;&#160;&#160;&#160;&#160;<a href='http://bit.ly/yq10RE' target='_blank'><img alt='Add to Google' border='0' src='http://gmodules.com/ig/images/plus_google.gif'/></a></p>
<div class='ut-cross'><a href='javascript:hide_cross();'>X</a></div>
</div>
<script language='JavaScript'>
function hide_cross() {
crosstbox = document.getElementById(&quot;ut-sticky&quot;);
crosstbox.style.visibility = &#39;hidden&#39;;
}
</script>

谢谢!

1 个答案:

答案 0 :(得分:0)

不会将到期日设定为明天@ 12am完成工作吗?