jquery實現未經美化的簡潔TAB菜單效果,jquery美化tab菜單

來源:互聯網
上載者:User

jquery實現未經美化的簡潔TAB菜單效果,jquery美化tab菜單

本文執行個體講述了jquery實現未經美化的簡潔TAB菜單效果。分享給大家供大家參考。具體如下:

這是一個看上去未經美化的簡潔TAB選項卡,觸發類的動作都是完整的,有興趣的自己進行美化,美化漂亮了還是相當不錯的,代碼簡潔,對學習參考比較不錯,使用了jQuery外掛程式。

運行效果如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/jquery-show-tab-plug-style-codes/

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>未經美化的簡潔TAB</title><style>body {font:normal 12px/20px simsun; margin:0 auto; padding:0;} * {margin: 0px; padding: 0px;}h4{font-size:14px;}h5{font-size:12px;}img {border:none;}ul,li{list-style-type:none;}a{text-decoration:none;}a:link{text-decoration:none;}a:hover{text-decoration:underline; color:#ffae00;}#tab{width:240px; margin:0 auto; text-align:center;}.menu{height:35px; line-height:32px; padding-top:1px;}.menu a{display:inline-block; height:35px; line-height:35px; width:116px; text-align:center; font-size:20px; color:#999999; font-weight:bold;}.menu a:hover, .menu a.on{color:#d33b55; text-decoration:none;}.cnt{border:1px solid #999999; width:240px; height:100px;}</style><script type="text/javascript" src="jquery-1.6.2.min.js"></script><script type="text/javascript"> $(document).ready(function(){ $(".menu a").each(function(i){  $(this).click(function(){   $(".menu a").removeClass("on").eq(i).addClass("on");   $(".cnt").hide().eq(i).show();   return false; //防止a跳轉;  }) }) });</script></head><body><div id="tab"> <div class="menu"> <a href="#" class="on">ASP源碼</a> <a href="#">Java源碼</a> </div> <div class="cnt"> <ul> <li>ASP源碼1</li> <li>ASP源碼2</li> <li>ASP源碼3</li> </ul> </div> <div class="cnt" style="display:none;"> <ul> <li>Java源碼1</li> <li>Java源碼2</li> <li>Java源碼3</li> </ul> </div> </div></body></html>

希望本文所述對大家的jquery程式設計有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.