2011-01-12 29 views
1

我正在進行選項卡式導航,這裏是一個example。目前這個比賽滑過上/下,但我想讓它消失/出現。有任何想法嗎?jQuery:只顯示/隱藏,而不是slideIn/Out

// When the document loads do everything inside here ... 
    $(document).ready(function(){ 

    // When a link is clicked 
     $("a.tab").click(function() {    

      // switch all tabs off 
      $(".active").removeClass("active"); 

      // switch this tab on 
      $(this).addClass("active"); 

      // slide all content up 
      $(".content").slideUp(); 

      // slide this content up 
      var content_show = $(this).attr("title"); 
      $("#"+content_show).slideDown(); 

     }); 

     }); 

回答

8

更換

$(".content").slideUp(); 

$(".content").hide(); 

$("#"+content_show).slideDown(); 

$("#"+content_show).show(); 
0

$(".content").fadeOut(); 

$("#"+content_show).fadeIn();