I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div\'s and Show div2
Third Click
I would probably do something like: (The following assumes all your $(document).ready(function() {
var $allDivs = $("#container > div");
var counter = 0;
$("#container > div").click(function(){
counter = counter < $allDivs.length - 1 ? counter + 1 : 0;
$allDivs.not(":eq("+counter +")").hide("fast");
$allDivs.eq(counter).show("fast");
});
});