尝试使用此Colorbox脚本设置Cookie。一切都有效,除了cookie部分,我相信它是因为脚本中的项目顺序。我希望cookie在1天后到期。这是剧本:感谢任何帮助!谢谢!
<script src="Navigation/jquery.min.js"></script>
<script src="Navigation/jquery.slimmenu.min.js"></script>
<script src="ColorBox/jquery.colorbox.js"></script>
<script type="text/javascript" charset="utf-8">
<!--
$(window).load(function() {
$('ul.slimmenu').slimmenu(
{
resizeWidth: '750', /* Navigation menu will be collapsed when document width is below this size or equal to it. */
collapserTitle: 'Main Menu', /* Collapsed menu title. */
animSpeed: 'medium', /* Speed of the submenu expand and collapse animation. */
easingEffect: null, /* Easing effect that will be used when expanding and collapsing menu and submenus. */
indentChildren: false, /* Indentation option for the responsive collapsed submenus. If set to true, all submenus will be indented with the value of the option below. */
childrenIndenter: ' ' /* Responsive submenus will be indented with this character according to their level. */
});
$(document).ready(function() {
setTimeout(function() {
$.colorbox({width:"75%", height:"75%", iframe:true, href:"/Announcements/CurrentAnnouncement.htm"});
}, 3000); // After 3 secs
setTimeout(function () { $.fn.colorbox.close(); }, 10000); // After 10 secs
});
if ($.cookie('test_status') != '1')
{
setTimeout(function()
{
alert('foo');
jQuery.cookie('test_status', '1', { expires: 1});
}, 1000);
}
});
});
&#13;