tab.js 458 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
$(function() {

	$("ul.switchingTab li a").click(function(){ 

		$("div.tabUnitList").each(
			function(i) {
				var thisID = "#list_"+i;
				if($(thisID).css("display") == "block"){
					$(thisID).css("display","none");
				}
			}
		);

		$("ul.switchingTab li a").removeClass("current");
		$(this).addClass("current");
		var tabTarget = $(this).attr("href");
		var tabTargetID = tabTarget;
		$(tabTargetID).css("display","block");
		return false;
	});
});