How can I reduce the amount of children I use in my jQuery functions?

后端 未结 5 2020
一生所求
一生所求 2021-01-31 20:10

I feel like I have to use way too many .children() in some of my jQuery functions.

Here\'s my HTML:

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 20:27

    have you heard about .find() ?

    $('.goal-small-container').hover(function() {
      $(this).find('.goal-actions').css({visibility: "visible"});
    }, function () {
      $(this).find('.goal-actions').css({visibility: "hidden"});
    });
    

提交回复
热议问题