toggle, hide show 2 divs with one button
Hi,
I have a probelm with solving this issue.
I have 2 divs: <div id="box1></div> and <div id="box2></div>
I also have one link to contoll them both.
The effect I want to get is: when I click first time on my link box2 hides, when i click second time also box1 hides, when I click third time both divs should show.
I manage to do that both divs hiding but later I can't get the show.
Im trying sth like this:
- $(document).ready(function() {
$('.slick-hide').click(function() {
$('#box2').hide('fast');
$('.slick-hide').click(function() {
$('#box1').hide('fast');
$(".slick-hide").removeClass("slick-hide").addClass("slick-show");
$('.slick-show').click(function() {
$('#box1').show('slow');
$('#box2').show('slow');
$(".slick-show").removeClass("slick-show").addClass("slick-hide");
return false;
});
return false;
});
return false;
});
});
but its working just for one time, later its getting crazy...
the html is:
<div id="box1"></div>
<div id="box2"></div>
<a class="slick-hide" href="#">link</a>
Can anyone help please?