Is it possible to combine $(this)
with $('.someclass')
?
Example: $(this + ', .someclass').hover()
;
I am attempting to use the hover action to animate a non-descendent class. I want the class element to animate whether "it", aka $('.someclass') OR $(this) is hovered.
I'm hoping this can be done without creating 2 separate hover actions.
jQuery - Multiple Elements SelectorYou can specify any number of selectors to combine into a single result.
You can use jQuery's .add()
.
$(this).add('.someClass').hover();
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