/* * cookie storage for jquery collapse * -- * source: http://github.com/danielstocks/jquery-collapse/ * site: http://webcloud.se/jquery-collapse * * @author daniel stocks (http://webcloud.se) * copyright 2013, daniel stocks * released under the mit, bsd, and gpl licenses. */ /* �������������֮�� www.lanrenzhijia.com */ (function($) { var cookiestorage = { expires: function() { var now = new date(); return now.setdate(now.getdate() + 1); }(), setitem: function(key, value) { document.cookie = key + '=' + value + '; expires=' + this.expires +'; path=/'; }, getitem: function(key) { key+= "="; var item = ""; $.each(document.cookie.split(';'), function(i, cookie) { while (cookie.charat(0)==' ') cookie = cookie.substring(1,cookie.length); if(cookie.indexof(key) === 0) { item = cookie.substring(key.length,cookie.length); } }); return item; } }; $.fn.collapse.cookiestorage = cookiestorage; })(jquery); /* �������������֮�� www.lanrenzhijia.com */