jQuery 菜单,可以智能判断是否是当前导航,如果是,则给当前的菜单项添加一个标记,而你的CSS文件并不需要重新定义,完全交给jQuery 来处理,现在有些朋友或许已经明白了,是jQuery让这种智能菜单变得更加有创意。
<html> jQuery智能判断是否是当前导航并加标记_网页代码站(www.webdm.cn) body,h1,h2,h3,h4,h5,h6,p,ul,li,dl,dt,dd{padding:0;margin:0;} li{list-style:none;}img{border:none;}em{font-style:normal;} a{color:#555;text-decoration:none;outline:none;blr:this.onFocus=this.blur();} a:hover{color:#000;text-decoration:underline;} body{font-size:12px;font-family:Arial,Verdana, Helvetica, sans-serif;word-break:break-all;word-wrap:break-word;} .clear{height:0;overflow:hidden;clear:both;} .nav{width:950px; height:29px; margin:20px auto 0;background:url(http://www.webdm.cn/images/20101216/1/navbg.gif) repeat-x 0 -180px;position:relative;} .navl{position:absolute;left:0;width:3px;height:29px;background:url(http://www.webdm.cn/images/20101216/1/navbg.gif) no-repeat 0 -150px;} .navr{position:absolute;right:0;width:3px;height:29px;background:url(http://www.webdm.cn/images/20101216/1/navbg.gif) no-repeat right -150px;} .nav ul{margin-left:10px;} .nav ul li{float:left;line-height:29px;display:inline;text-align:center;padding-left:5px; font-size:14px;font-weight:bold;background:url (http://www.webdm.cn/images/20101216/1/navbg.gif) no-repeat right -208px;} .nav ul li a{float:left;color:#FFF; padding:0 10px;} .nav ul li.select{background:url(http://www.webdm.cn/images/20101216/1/navbg.gif) repeat-x 0 -240px; position:relative;margin-top:-4px;} .nav ul li.select a{background:url(http://www.webdm.cn/images/20101216/1/navbg.gif) repeat-x right -240px;height:33px;line-height:33px;color:#333; text-indent:-3px;}