55
rated 0 times
[
59]
[
4]
/ answers: 1 / hits: 22309
/ 9 Years ago, fri, august 21, 2015, 12:00:00
I have some problems with show/hide element. I have 2 popups on one page and I need hide one popup if another popup has class.
For example:
<body class=home>
<div class=popup main></div>
<div class=popup></div>
</body>
So, if body.home has .main I need to show only .main popup and hide or remove another .popup.
I'va tried
if ($('.home').find('.main')) {
$('.home').find('.main').show();
$('.home').find('.popup').remove();
}
But it does not working as I need, because in some reason I'll have code only with one popup block
<body class=home>
<div class=popup></div>
</body>
More From » jquery