$(document).ready(function(){
var ScreenSizeHis = $.cookie(ScreenSizeHis);
$("#arrow").bind('click', function(){
$('#naviclosed').fadeIn("fast");
$(window).unbind('resize');
});
$('#naviclosed').bind('click', function () {
$('#naviclosed').fadeOut("fast");
if ((ScreenSizeHis = $.cookie('ScreenSizeHis')) != undefined) {
$(window).bind('resize', ScreenSize);
}
});
});
$(window).resize(function() {
ScreenSize();
});
$(document).ready(function() {
windowwidth = $(window).width();
if (windowwidth < 1040) {
$('#naviclosed').fadeIn("fast");
}
if (windowwidth >= 1040) {
$('#naviclosed').fadeOut("fast");
}
});
function ScreenSize() {
windowsize = $(window).width();
if (windowsize < 1040) {
$('#naviclosed').fadeIn("fast");
}
if (windowsize >= 1040) {
$('#naviclosed').fadeOut("fast");
}
}
好吧,在我放入cookie插件后,按钮甚至无法正常工作。
答案 0 :(得分:0)
您可以通过向$.cookie
提供更多参数来设置Cookie。单个参数用于检索:
//name, value, additional -- expire cookie in 30 days
$.cookie('ScreenSizeHis', ScreenSizeHis, {expires: 30});