enter image description here

It is necessary that when you hover on a certain .card in .fastview , .backet and .click class .hide removed. Could only write

 $(function() { $(".card").mouseover(function() { $(".basket, .click, .fastview").removeClass("hide"); }); $(".card").mouseout(function() { $(".basket, .click, .fastview").addClass("hide"); }) }) 

as a result, the class .hide is removed on all .card , but only on the one you direct. help who than can)

  • Need a piece of code for specific help. At least one block. - Ruslan Semenov
  • .card: hover will lead to the same problem that I asked, you could name each card in its own way, for example .card1, .card2, etc., and you would have to write .card1: hover, .card2: hover, and if such 100? crazy you can go - ur pride

1 answer 1

You can get the card that you hover over, like this:

 $(this) 

Then you can use the find method to find objects on this card whose styles need to be changed.

 $(function() { $(".card").mouseover(function() { $(this).find(".basket, .click, .fastview").removeClass("hide"); }); $(".card").mouseout(function() { $(this).find(".basket, .click, .fastview").addClass("hide"); }); }); 
  • one
    God forbid you health: D helped) - ur pride