I feel like I have to use way too many .children()
in some of my jQuery functions.
Here's my HTML:
<div class="goal-small-container">
<div class="goal-content">
<div class="goal-row">
<span class="goal-actions">
And here's my 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"});
});
Is there a better way? How can I reduce the amount of children I use in my jQuery functions?
.find('.goal-content .goal-row .goal-action').whatever()
or more simply:
.find('.goal-action').whatever()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With