A new CSS Menu code _ Experience Exchange

Source: Internet
Author: User
<ptml> <pead> <script> if (!document.getelementbyid) document.getElementById = function () {RET Urn null; function Initializemenu (MENUID, Actuatorid) {var menu = document.getElementById (MENUID); var actuator = document.getElementById (Actuatorid); if (menu = NULL | | actuator = NULL) return; if (Window.opera) return; Im too tired actuator.parentNode.style.backgroundImage = "url (/images/plus.gif)"; Actuator.onclick = function () {var display = Menu.style.display; This.parentNode.style.backgroundImage = (Display = = "block")? "URL (/images/plus.gif)": "URL (/images/minus.gif)"; Menu.style.display = (Display = = "block")? "None": "Block"; return false; } window.onload = function () {Initializemenu ("Productsmenu", "Productsactuator"); Initializemenu ("Newphonesmenu", "Newphonesactuator"); Initializemenu ("Comparemenu", "compareactUator "); } </script> <style> Body {font-family:verdana, Helvetica, Arial, Sans-serif; } #mainMenu {background-color: #EEE; border:1px solid #CCC; Color: #000; width:203px; } #menuList {margin:0px; padding:10px 0px 10px 15px; } li.menubar {Background:url (/images/plus.gif) no-repeat 0em 0.3em; font-size:12px; Line-height:1.5em; List-style:none outside; }. menu,. submenu {display:none; margin-left:15px; padding:0px; }. Menu Li,. submenu li {background:url (/images/square.gif) no-repeat 0em 0.3em; List-style:none outside; } a.actuator {background-color:transparent; Color: #000; font-size:12px; padding-left:15px; Text-decoration:none; } a.actuator:hover {text-decoration:underline; }. Menu Li A,. submenu li a {background-color:transparent; Color: #000; font-size:12px; padding-left:15px; Text-decoration:none; }. Menu Li A:hover, submenu Li a: hover {/*border-bottom:1px dashed #000; * * text-decoration:underline; } span.key {text-decoration:underline; } </style> </pead> <body> <div id= "MainMenu" > <ul id= "menulist" > <li class= "MenuBar" > Phones <ul id= "Productsmenu" class= "menu" > <li> New Phones <ul id= "Newphonesmenu" class= "submenu" > <li>9290</li> <li>8390</li> <li>8290</li> <li>8270< /li> </ul> </li> <li> Compare <ul id= "Comparemenu" class= "submenu" > <li>all phones</li> <li>se Rvice provider</li> </ul> </li> </ul> </li> </ul> </div> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.