jquery cookie for jquery animate

jquery cookie for jquery animate

本文关键字:jquery animate cookie for      更新时间:2023-09-26

好的,这是我到目前为止的代码

$(window).load(function() { 
        $("#notify").animate({top: 0}, 200, null);
        //for css positioning prblem
        $("#notify").css("position", "relative");
}); // end window load 
$(document).ready(function(){
    //Hide notify bar
    $('.notify-close').click(function(){
        $("#notify").slideToggle({top: -100}, 300, function() {
            $("#notify").css("position", "absolute");
        });
    });
});

我怎样才能做到这一点,以便当用户单击带有类的按钮时.notify-close下一个时间限制,通知栏不会显示。

这将为你工作,

$(window).load(function() { 
        if($.cookie("mynotifycookie")=="read") {
            $("#notify").animate({top: 0}, 200, null);
            //for css positioning prblem
            $("#notify").css("position", "relative");
        }
        else {
            $("#notify").css("display", "none");                
        }
}); // end window load 
$(document).ready(function(){
    //Hide notify bar
    $('.notify-close').click(function(){
        $.cookie("mynotifycookie", "read", , { expires: 9999 });
        $("#notify").slideToggle({top: -100}, 300, function() {
            $("#notify").css("position", "absolute");
        });
    });
});