jquery选项卡导航菜单

jquery选项卡导航菜单,jquery,tabs,navigation,Jquery,Tabs,Navigation,我刚开始学习jQuery,所以我是个初学者 我的目标是创建一个选项卡导航菜单。我在这里编写了以下代码: $(".tab_content").hide(); $(".tab_content:first").show(); $("ul.tabs li").click(function() { $(".tab_content").hide(); var h_active = $(this).attr("rel"); $("#"+h_active).fadeIn(500);

我刚开始学习jQuery,所以我是个初学者

我的目标是创建一个选项卡导航菜单。我在这里编写了以下代码:

$(".tab_content").hide();
$(".tab_content:first").show();


$("ul.tabs li").click(function() {

  $(".tab_content").hide();
  var h_active = $(this).attr("rel"); 
  $("#"+h_active).fadeIn(500);      

  $("ul.tabs li").removeClass("active");
  $(this).addClass("active");

  $(".v_tabs").removeClass("v_active");
  $(".v_tabs[rel^='"+h_active+"']").addClass("v_active");

});
但在网上阅读时,我意识到这并不是最好的

下面是查看整个代码的示例:

如何添加淡出过渡

$("#selectorForElement").fadeOut(1000); //fadeout for 1 second