JS implementation of the four-level left site category Menu instance

Source: Internet
Author: User

This article describes the JS implementation of the four-level left site category menu. Share to everyone for your reference. The implementation methods are as follows:

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 5, 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 11 9 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148-149 150 151 152 153 154 155 156 157 158 159 160 161 162-163 <! 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 "xml:lang=" en "lang=" en "> <head> <meta http-equiv=" Content-type "content=" text/html; Charset=iso-8859-1 "/> <script src= http://www.google-analytics.com/urchin.js" type= "Text/javascript" > </script> <script type= "Text/javascript" > _uacct = "ua-152060-1"; Urchintracker (); </script> <title>demo</title> <style type= "Text/css" > <!--body {font-family:arial, Helvetica, Sans-serif; font-size:11px; #nav, #nav ul {list-style:none; background: #F9F9F9; font-weight:bold; padding:0px; margin:0px; border:solid 1px # CCCCCC; border-bottom:0px; width:150px; Text-align:left; #nav ul ul{border:solid 1px #CCCCCC; border-bottom:0px} #nav a {display:block; width:150px; width:140px; color: #333333; Text-decoration:none; Text-align:center; Border-bottom: solid 1px #CCCCCC; Text-align:left; padding-left:10px; #nav a:hover{color: #336666; #nav a.selected{background:url (/images/bb_expand.gif) No-repeat right 50%;} #nav li { line-height:22px; position:relative; #nav Li ul {position:absolute; left: -999em; width:150px; font-weight:normal; margin:0px; padding:0px; #nav Li L I {width:150px} #nav li ul a {width:150px; width:126px; padding:0px 12px; line-height:22px; text-align:left;} Nav Li ul ul {margin:0px 0 0 150px;} #nav Li:hover ul ul, #nav Li.sfhover ul ul, #nav Li:hover ul ul ul{left: -999em;} #nav Li:hover ul, #nav Li Li:hover ul, #nav li.sfhover ul, #nav Li Li.sfhover ul, #nav Li Li Li:hover ul {left:auto;} #n AV li:hover ul, #nav li.sfhover ul{left:150px top:0px;} #nav li:hover, #nav li.sfhover {background: #F5E3C0;} * HTML #nav li {float:left; height:1%} * HTML #nav li a {height:1%}--> </style> <script type= "Text/javascr IPT "> <!--//--><! [cdata[//><!--Sfhover = function () {var sfels = document.getElementById ("Nav"). getElementsByTagName ("LI"); for (var i=0; i<sfels.l Ength; i++) {sfels[i].onmouseover=function () {this.classname+= "Sfhover";} sfels[i].onmouseout=function () {this.className= This.className.replace (New RegExp ("Sfhoverb"), ""); }} if (window.attachevent) window.attachevent ("onload", sfhover); --><!]] > </script> </head> <body> <p><a href= "Javascript:history.back ()" >Back</a> </p> <ul id= "nav" > <li><a href= "" >Home</a></li> <li><a href= " Aboutme.html ">about me</a></li> <li><a class=" selected "href="/tutorials.html "> tutorials</a> <ul> <li><a href= "#" >sub menu 31</a></li> <li><a " Selected "href=" # ">sub menu 32</a> <ul> <li><a class=" selected "href=" # ">sub menu 321</a ><ul> <li><a href= "#" >sub menu 321</a></li> </ul></li> <li><a href= "#" >sub menu 322</a></li> <li> <a href= "#" >sub menu 323</a></li> <li><a class= "selected" href= "#" >sub menu 324</a ><ul> <li><a href= "#" >sub menu 321</a></li> <li><a href= "#" >sub Menu 322 </a></li> <li><a href= "#" >sub menu 323</a></li> <li><a href= "#" >sub Menu 324</a></li> </ul></li> </ul> </li> <li><a href= "#" >sub Menu 33 </a></li> <li><a href= "#" >sub menu 34</a></li> </ul> </li> <li> <a class= "selected" href= "/gallery/gallery.html" >Gallery</a> <ul> <li><a href= "#" >sub Menu 41</a></li> <li><a class= "selected" href= "#" >sub menu 42</a> <ul> <li> <a href= "#" >sub menu 421</a></li> <li><a href="#" >sub menu 422</a></li> <li><a href= "#" >sub menu 423</a></li> <li>< A href= "#" >sub menu 424</a></li> </ul> </li> <li><a href= "#" >sub menu 43</a ></li> <li><a href= "#" >sub menu 44</a></li> </ul> </li> <li><a href= "#" >contact me</a></li> </ul> </body> </html>

I hope this article will help you with your JavaScript programming.

Note : For more wonderful tutorials, please pay attention to the triple graphics tutorial channel,

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.