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

Javascript Notification Bar - Make it appear only once per day?

本文关键字:显示 一次 每天 通知 Javascript      更新时间:2023-09-26

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

<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>

谢谢!

难道不把到期日设置为明天上午12点就可以了吗?