http://jsfiddle.net/T8t2r/294/
在上面的示例中,当我单击父类时,它应该向下滑动子类,但它没有正确滑动。有人可以帮我吗?
jQuery
$(document).ready(function() {
function getChildren($row) {
var children = [];
while($row.next().hasClass('child')) {
children.push($row.next());
$row = $row.next();
}
return children;
}
$('.parent').on('click', function() {
var children = getChildren($(this));
$.each(children, function() {
$(this).toggle();
})
});
})