我觉得我必须在我的一些jQuery函数中使用太多的.children()
。
这是我的HTML:
<div class="goal-small-container">
<div class="goal-content">
<div class="goal-row">
<span class="goal-actions">
下面是我的jQuery:
$('.goal-small-container').hover(function() {
$(this).children('.goal-content').children('.goal-row').children('.goal-actions').css({visibility: "visible"});
}, function () {
$(this).children('.goal-content').children('.goal-row').children('.goal-actions').css({visibility: "hidden"});
});
有没有更好的方法?我怎样才能减少我的jQuery函数中使用的孩子数量?
https://stackoverflow.com/questions/3852260
复制相似问题