- live() 1.9以上被淘汰。 替代函数:.on()。
- die() 1.9以上被淘汰。 替代函数:.off()。
- .size() 1.8以上被淘汰。替代函数:.length。
.toggle() 1.8以上被淘汰。
- 方法1:
$(".one .top").click(function() { if($(".content").css("display")=="none"){ $(".content").show(1500); $(".iocn").addClass("jian"); }else { $(".content").hide("slow"); $(".iocn").addClass("jia"); } });
- 方法2:
var i=0; $(".one .top").click(function() { if(i==0){ $(".content").hide("slow"); $(".iocn").addClass("jia"); i=1; }else { $(".content").show(1500); $(".iocn").addClass("jian"); i=0; } });