From 2358a5c1e3a2ac8c0220e2384f5f88747fdba929 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 8 Aug 2011 09:18:45 +0000 Subject: improved language tabs --- h-source/Public/Js/functions.js | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'h-source/Public/Js') diff --git a/h-source/Public/Js/functions.js b/h-source/Public/Js/functions.js index c3661cd..9111ba4 100644 --- a/h-source/Public/Js/functions.js +++ b/h-source/Public/Js/functions.js @@ -137,4 +137,47 @@ function moderator_dialog(md_action,md_type) }); } +function animateTabs(defaultTag) +{ + $(".description_tabs").each(function(){ + + var that = $(this); + showTab(that,defaultTag); + $(this).find("li.desc_tabs a").click(function(){ + + var t_ref = $(this).attr("href").replace(/\#/, ""); + showTab(that,t_ref); + return false; + }); + }); + +} + +//show a single tab +function showTab(descObject,tagLabel) +{ + $(".separation_line").css("display","none"); + descObject.find(".description_tabs_page").css("display","none"); + descObject.find(".desc_tabs").removeClass("current_tab"); + if (descObject.find("#description_tabs_content").find("#"+tagLabel).length > 0) + { + descObject.find("#description_tabs_content").find("#"+tagLabel).css("display","block"); + descObject.find(".desc_menu").find("."+tagLabel).addClass("current_tab"); + } + else + { + if (descObject.find("#description_tabs_content").find("#en").length > 0) + { + descObject.find("#description_tabs_content").find("#en").css("display","block"); + descObject.find(".desc_menu").find(".en").addClass("current_tab"); + } + else + { + descObject.find("#description_tabs_content").find(".description_tabs_page").first().css("display","block"); + descObject.find(".desc_menu li").first().addClass("current_tab"); + } + } +// $("#description_tabs_content").find("#"+tagLabel).css("display","block"); +} + //--> \ No newline at end of file -- cgit v1.2.3