最赞回答 / 幸福的小草
li:has('label'))是选择包含<label>的<li>,而不是选中label,同理,body:has('label')是选择包含<label>的<body>,如果body元素内包含<label>,很明显是有包含的。所以选中body,就看到的整个body背景色改变了
2015-06-21
$("span").stop(false,1):仍然执行完此次动画再停止;$("span").stop();无参数或只有一个参数,会停止所有动画
2015-06-21
("div").unbind("click dblclick"),这种好像移除不了双击事件啊
2015-06-21
emove()方法删除所选元素本身和子元素,通过添加过滤参数指定需要删除的某些元素;
empty()方法则只删除全部所选元素的子元素内容.
empty()方法则只删除全部所选元素的子元素内容.
2015-06-21
$("#content").css("background-color","red").css("color","white");
$("#content").css({"background-color":"red","color":"white"});注意加大括号
$("#content").css({"background-color":"red","color":"white"});注意加大括号
2015-06-21
$(".drag").each(function(index, data){
$(this).draggable({axis: index == 0? "x":"y"});
});
$(this).draggable({axis: index == 0? "x":"y"});
});
2015-06-20
$(".drag").each(function(index, data){
if(index == 0){
$(this).draggable({axis: "x"});
}
else {
$(this).draggable({axis: "y"});
}
});
if(index == 0){
$(this).draggable({axis: "x"});
}
else {
$(this).draggable({axis: "y"});
}
});
2015-06-20