Making jQuery remember which DIV-Container was shown
Hello everybody,
I am new to jQuery and not very familiar with OOP, so please don't hit me
I have the following question: I want each button to show a different div.
So far my solution is:
-
$("#container2").hide();
$("#container3").hide();
$("#show1").click(function() {
$("#container1").fadeOut(200,function(){
$("#container2").fadeIn(200);
});
});
$("#show2").click(function() {
$("DIV-ID OF THE PREVIOUS SHOWN CONTAINER").fadeOut(200,function(){
$("#container2").fadeIn(200);
});
});
I don't want to tell jQuery to fade out all my DIV's before the new one to fade in. So, how can I tell jQuery to fade out the previous shown DIV before fading in the new DIV?
Thank you very much for your help and have a good day
