登录之后只提示一次的提示框
<script> $(document).ready(function () { //判断cookie中是否展示过的状态 1为展示过 animate为JQ中的动画 if (!getCookie("noticebombox")) { $(".noticebom-box").animate({ height: "200px" }, 2000); $(".noticebom-i").click(function () { $(".noticebom-box").animate({ height: "0px" }, 1000); }) document.cookie = "noticebombox=1"; } })
//读取cookie,解析得到值 function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return ""; } </script>