http://www.zhangxinxu.com/stu...
看到了大神的代码,想知道为什么要这样来隐藏元素,是有什么好处吗
eleLeftMenuTit.store("display", true).addEvent("click", function() {
var eleTarget = $(this.getProperty("data-rel"));
if (eleTarget) {
if (this.retrieve("display")) {
eleTarget.setStyles({
position: "absolute",
left: "-9999em"
});
this.setProperty("title", "展开").getElement(".u").removeClass("u29").addClass("u39");
this.store("display", false);
} else {
eleTarget.setStyle("position", "static");
this.setProperty("title", "收起").getElement(".u").removeClass("u39").addClass("u29");
this.store("display", true);
}
//存储
funStoreDisplay();
}
return false;
});
慕桂英3389331
相关分类