Reputation: 765
I am trying to toggle hide/show on multiple elements, and it works on mobile, however on desktop, my code seems to hide/show all of them instead of the parent that is being clicked on.
var t = $(this).find*
$('div a i').click(function(){
$('.text').toggleClass('show');
});
Here is a CodePen with my markup.
Any help is appreciated!
Upvotes: 2
Views: 211
Reputation: 2819
did you try this?
Edit to your comment:
$('div.pop-up').click(function(){
$('.text').removeClass('show');
$(this).find('.text').toggleClass('show');
});
You have to say which div to click by class, otherwise, partent div's are clicked as will...
Upvotes: 3
Reputation: 152
It's for the a:hoover
html > body a:hover + .text { display: block; }
If you trigger the div,the text don't disappear
Upvotes: 0