Jquery tab 選項卡 無重新整理切換

來源:互聯網
上載者:User

標籤:

轉載的

示範地址:http://www.freejs.net/demo/29/index.html

首頁>>TAB標籤>>jquery實現簡單的Tab切換菜單(2013-09-09)jquery實現簡單的Tab切換菜單 示範  

 js代碼

JavaScript Code
  1. <script type="text/javascript">  
  2.   
  3. $(document).ready(function() {  
  4.   
  5.     //Default Action  
  6.     $(".tab_content").hide(); //Hide all content  
  7.     $("ul.tabs li:first").addClass("active").show(); //Activate first tab  
  8.     $(".tab_content:first").show(); //Show first tab content  
  9.       
  10.     //On Click Event  
  11.     $("ul.tabs li").click(function() {  
  12.         $("ul.tabs li").removeClass("active"); //Remove any "active" class  
  13.         $(this).addClass("active"); //Add "active" class to selected tab  
  14.         $(".tab_content").hide(); //Hide all tab content  
  15.         var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content  
  16.         $(activeTab).fadeIn(); //Fade in the active content  
  17.         return false;  
  18.     });  
  19.   
  20. });  
  21. </script>  

主要代碼

 

XML/HTML Code
  1. <div class="container">  
  2.       
  3.     <ul class="tabs">  
  4.         <li class="active"><a href="#tab1">導覽功能表</a></li>  
  5.         <li><a href="#tab4">TAB標籤</a></li>  
  6.     </ul>  
  7.     <div class="tab_container">  
  8.         <div id="tab1" class="tab_content" style="display: block; ">  
  9.              
  10.           <h3><a href="http://www.freejs.net/article_daohangcaidan_13.html">jquery css多級下拉式功能表</a></h3>  
  11.             <p id="">多級菜單,理論上支援無限多的層級,檔案結構非常簡單的,具體的請看下面的內容</p>  
  12.         </div>  
  13.           
  14.         <div id="tab4" class="tab_content" style="display: none; ">  
  15.             <h2>各種tab標籤選項卡</h2>  
  16.             <h3><a href="http://www.freejs.net/article_tabbiaoqian_17.html">tab標籤頁面,ajax載入</a></h3>  
  17.               
  18.             <p> tab標籤,jquery ajax載入資料庫的內容</p>  
  19.         </div>  
  20.     </div>  
  21.   
  22. </div>  

 

Jquery tab 選項卡 無重新整理切換

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.