var Remember = new Object();
Remember = function(){};
Remember.prototype = {
initialize: function(el, options){
this.el = $(el);
this.days = 365;
this.options = options;
this.effect();
var cookie = this.readCookie();
if (cookie) {
this.fx.now = cookie;
this.fx.increase();
}
},
//cookie functions based on code by Peter-Paul Koch
setCookie: function(value) {
var date = new Date();
date.setTime(date.getTime()+(this.days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/";
},
readCookie: function() {
var nameEQ = this.el+this.el.id+this.prefix + "=";
var ca = document.cookie.split(';');
for(var i=0;c=ca[i];i++) {
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return false;
},
custom: function(from, to){
if (this.fx.now != to) {
this.setCookie(to);
this.fx.custom(from, to);
}
}
}
就是这段代码,看了半天没看明白,下面这3行,每行是什么意思呢?
date.setTime(date.getTime()+(this.days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/";