是啊 你看那段代码 ddaccordion.setCookie(config.headerclass, expandedindices) 这个方法里面就是写cookie的封装 当加载页面的时候 还有个 getCookie
写个cookie $(window).bind('unload', function(){ //clean up and persist on page unload $('.'+config["headerclass"]).unbind() var expandedindices=[] $('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers expandedindices.push($(this).attr('contentindex')) }) if (config.persiststate==true && $('.'+config["headerclass"]).length>0){ //persist state? expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value? ddaccordion.setCookie(config.headerclass, expandedindices) } }) 很坏啊 在unload的时候才记录 那个面板被关闭 ddaccordion.setCookie(config.headerclass, expandedindices)
61,112
社区成员
60,730
社区内容
加载中
试试用AI创作助手写篇文章吧