JS實現不規則TAB選項卡效果代碼_javascript技巧

來源:互聯網
上載者:User

本文執行個體講述了JS實現不規則TAB選項卡效果代碼。分享給大家供大家參考。具體如下:

這是一款不規則TAB選項卡效果,將中規中矩的方角換成了不規則的圓角,也就是這一換,倒讓瀏覽者新鮮了不少,也使選項卡增多了幾份靈感,不是嗎?

運行效果截圖如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/js-box-tab-nav-style-menu-codes/

具體代碼如下:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>不規則TAB選項卡效果</title><style type="text/css"><!--body,td{font-size: 12px;}.tab{margin-top:100px}#TabCon1{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}#TabCon2{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}.xixi1{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover1.gif);cursor:pointer;}.xixi2{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover2.gif);cursor:pointer;}.tab1{width:96px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer; color:#FFF;}.tab2{width:116px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer;color:#000;}--></style></head><body style="text-align:center"><script type="text/javascript"> function setTab03Syn ( i ) {  selectTab03Syn(i); } function selectTab03Syn ( i ) {  switch(i){   case 1:   document.getElementById("TabCon1").style.display="block";   document.getElementById("TabCon2").style.display="none";   document.getElementById("font1").style.color="#ffffff";   document.getElementById("font2").style.color="#000000";   break;   case 2:   document.getElementById("TabCon1").style.display="none";   document.getElementById("TabCon2").style.display="block";   document.getElementById("font1").style.color="#000000";   document.getElementById("font2").style.color="#ffffff";   break;  } }</script><div class="tab"><div id="bg" class="xixi1"><div id="font1" class="tab1" onMouseOver="setTab03Syn(1);document.getElementById('bg').className='xixi1'">新聞標籤</div><div id="font2" class="tab2" onMouseOver="setTab03Syn(2);document.getElementById('bg').className='xixi2'">新聞標籤</div></div><div id="TabCon1">不規則TAB選項卡效果</div><div id="TabCon2" style="display:none">不規則TAB選項卡效果2</div></div></body></html>

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

聯繫我們

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