JS+CSS實現另類帶提示效果的豎嚮導航菜單,豎嚮導航菜單

來源:互聯網
上載者:User

JS+CSS實現另類帶提示效果的豎嚮導航菜單,豎嚮導航菜單

本文執行個體講述了JS+CSS實現另類帶提示效果的豎嚮導航菜單。分享給大家供大家參考。具體如下:

這是一款JS+CSS打造另類帶提示的豎嚮導航菜單,覺得挺不錯,只是美工水平有限,有興趣的朋友就請繼續完善吧。

運行效果如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/js-css-alert-txt-nav-menu-demo/

具體代碼如下:

<html><head><title>帶提示的豎嚮導航菜單</title><style type="text/css">#coolmenu{border: 1px solid black;width: 160px;background-color: #E6E6E6;}#coolmenu a{font: bold 13px Verdana;padding: 2px;padding-left: 4px;display: block;width: 100%;color: black;text-decoration: none;border-bottom: 1px solid black;}html>body #coolmenu a{width: auto;}#coolmenu a:hover{background-color: black;color: white;}#tabledescription{width: 100%;height: 3em;padding: 2px;filter:alpha(opacity=0);-moz-opacity:0;}</style><script type="text/javascript">var baseopacity=0function showtext(thetext){if (!document.getElementById)returntextcontainerobj=document.getElementById("tabledescription")browserdetect=textcontainerobj.filters? "ie" : typeof textcontainerobj.style.MozOpacity=="string"? "mozilla" : ""instantset(baseopacity)document.getElementById("tabledescription").innerHTML=thetexthighlighting=setInterval("gradualfade(textcontainerobj)",50)}function hidetext(){cleartimer()instantset(baseopacity)}function instantset(degree){if (browserdetect=="mozilla")textcontainerobj.style.MozOpacity=degree/100else if (browserdetect=="ie")textcontainerobj.filters.alpha.opacity=degreeelse if (document.getElementById && baseopacity==0)document.getElementById("tabledescription").innerHTML=""}function cleartimer(){if (window.highlighting) clearInterval(highlighting)}function gradualfade(cur2){if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.2, 0.99)else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)cur2.filters.alpha.opacity+=20else if (window.highlighting)clearInterval(highlighting)}</script></head><body><div id="coolmenu"><a href="#" onMouseover="showtext('精品指令碼代碼下載!')" onMouseout="hidetext()">開始吧</a><a href="#" onMouseover="showtext('常用特效收集與發布')" onMouseout="hidetext()">網頁特效</a><a href="#" onMouseover="showtext('網站地圖索引')" onMouseout="hidetext()">資源分類</a><a href="#" onMouseover="showtext('最新更新的資源')" onMouseout="hidetext()">最新更新</a><a href="#" onMouseover="showtext('網站最熱的下載')" onMouseout="hidetext()">下載排行</a><div id="tabledescription"></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.