I want to make an animation on a div child element when i hover the child of a different div this is my code:
$('.section li:nth-child(1)').hover(function(){
$('.section2 li:nth-child(1)').toggleClass('is-over');
});
$('.section li:nth-child(2)').hover(function(){
$('.section2 li:nth-child(2)').toggleClass('is-over');
});
$('.section li:nth-child(3)').hover(function(){
$('.section2 li:nth-child(3)').toggleClass('is-over');
});
$('.section li:nth-child(4)').hover(function(){
$('.section2 li:nth-child(4)').toggleClass('is-over');
});
So how can i optimize it?