我如何将相邻的选择器“+”与 $(this) 一起使用。
我需要有关注释行的帮助 //this does not work:
$(".ExpandCollapse").click(function () {
if ($(this).nextUntil('.Collapsable').is(':visible'))
{
//this doesnt work
$(this + ".Collapsable").hide();
}
else
{
//this doesnt work
$(this + ".Collapsable").show();
}
});
你能帮我一下吗?
预先非常感谢。
此致。
Jose
Use next() http://api.jquery.com/next/
$(this).next(".Collapsable").hide();
或者简单地:
$(this).next().hide();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)