子项的简单jQuery切换
嗯,为什么不工作?尝试使用以下选项切换ul:子项的简单jQuery切换,jquery,jquery-selectors,Jquery,Jquery Selectors,嗯,为什么不工作?尝试使用以下选项切换ul: $("#others").children(".btn").click(function(){ if ($(this).children("ul").is(":hidden")) { $(this).children("ul").slideDown(); } else { $(this).children("ul").slideUp(); } }); 以及: ... ... UL不是的孩子。
$("#others").children(".btn").click(function(){
if ($(this).children("ul").is(":hidden"))
{
$(this).children("ul").slideDown();
} else {
$(this).children("ul").slideUp();
}
});
以及:
...
...
UL不是的孩子。btn是兄弟姐妹,请尝试使用下一步:
$("#other a.btn").click(function(){
var ul = $(this).next("ul");
if (ul.is(":hidden")) {
ul.slideDown();
} else {
ul.slideUp();
}
});
UL不是的孩子。btn是兄弟姐妹,请尝试使用下一步:
$("#other a.btn").click(function(){
var ul = $(this).next("ul");
if (ul.is(":hidden")) {
ul.slideDown();
} else {
ul.slideUp();
}
});
你的第一个部门id是other,但你的活动肯定会与其他人联系?“嗯,为什么不工作?”-这有点烦人,仅供参考。对不起,咖啡太多了。下一次你会尽量不让自己听起来像一个呜呜叫的少女。这里有另一种方法:你的第一个部门id是其他的,但你的活动肯定会有其他人?“嗯,为什么不工作?”-这有点烦人,仅供参考。对不起,咖啡太多了。下次我会尽量不让自己听起来像个呜呜叫的少女。以下是其他方法: