舌下阜肿大:JavaScript+CSS无限极分类代码
来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 03:03:11
a {}{text-decoration:none;}
a,a:visited {}{color:#000;background:inherit;}
body {}{margin:0;padding:20px;font:12px tahoma,宋体,sans-serif;}
dt {}{font-size:22px;font-weight:bold;margin:0 0 0 15px;}
dd {}{margin:0 0 0 15px;}
h4 {}{margin:0;padding:0;font-size:18px;text-align:center;}
p {}{margin:0;padding:0 0 0 18px;}
p a,p a:visited {}{color:#00f;background:inherit;}
/**//*CNLTreeMenu Start*/
.CNLTreeMenu img.s {}{cursor:pointer;vertical-align:middle;}
.CNLTreeMenu ul {}{padding:0;}
.CNLTreeMenu li {}{list-style:none;padding:0;}
.Closed ul {}{display:none;}
.Child img.s {}{background:none;cursor:default;}
#CNLTreeMenu1 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu1 img.s {}{width:20px;height:15px;}
#CNLTreeMenu1 .Opened img.s {}{background:url(skin1/opened.gif) no-repeat 0 0;}
#CNLTreeMenu1 .Closed img.s {}{background:url(skin1/closed.gif) no-repeat 0 0;}
#CNLTreeMenu1 .Child img.s {}{background:url(skin1/child.gif) no-repeat 3px 5px;}
#CNLTreeMenu2 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu2 img.s {}{width:17px;height:15px;}
#CNLTreeMenu2 .Opened img.s {}{background:url(skin2/opened.gif) no-repeat 4px 6px;}
#CNLTreeMenu2 .Closed img.s {}{background:url(skin2/closed.gif) no-repeat 3px 6px;}
#CNLTreeMenu2 .Child img.s {}{background:url(skin2/child.gif) no-repeat 3px 5px;}
#CNLTreeMenu3 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu3 img.s {}{width:34px;height:18px;}
#CNLTreeMenu3 .Opened img.s {}{background:url(skin3/opened.gif) no-repeat 0 1px;}
#CNLTreeMenu3 .Closed img.s {}{background:url(skin3/closed.gif) no-repeat 0 1px;}
#CNLTreeMenu3 .Child img.s {}{background:url(skin3/child.gif) no-repeat 13px 2px;}
/**//*CNLTreeMenu End*/
/**//*Temp CSS for View Demo*/
#CNLTreeMenu1,#CNLTreeMenu2,#CNLTreeMenu3 {}{float:left;width:249px;border:1px solid #99BEEF;background:#D2E4FC;color:inherit;margin:3px;padding:3px;}
#CNLTreeMenu1,#CNLTreeMenu2 {}{padding-bottom:15px;}
.ViewCode {}{
clear:both;
border:1px solid #FFB900;background:#FFFFCC;color:inherit;margin:3px;padding:3px;
}
.ViewCode h6 {}{color:#00f;}
JavaScript
function Ob(o){
var o=document.getElementById(o)?document.getElementById(o):o;
return o;
}
function Hd(o) {
Ob(o).style.display="none";
}
function Sw(o) {
Ob(o).style.display="";
}
function ExCls(o,a,b,n){
var o=Ob(o);
for(i=0;i {o=o.parentNode;}
o.className=o.className==a?b:a;
}
function CNLTreeMenu(id,TagName0) {
this.id=id;
this.TagName0=TagName0==""?"li":TagName0;
this.AllNodes = Ob(this.id).getElementsByTagName(TagName0);
this.InitCss = function (ClassName0,ClassName1,ClassName2,ImgUrl) {
this.ClassName0=ClassName0;
this.ClassName1=ClassName1;
this.ClassName2=ClassName2;
this.ImgUrl=ImgUrl || "css/s.gif";
this.ImgBlankA ="";
this.ImgBlankB ="";
for (i=0;i {
this.AllNodes[i].className==""?this.AllNodes[i].className=ClassName1:"";
this.AllNodes[i].innerHTML=(this.AllNodes[i].className==ClassName2?this.ImgBlankB:this.ImgBlankA)+this.AllNodes[i].innerHTML;
}
}
this.SetNodes = function (n) {
var sClsName=n==0?this.ClassName0:this.ClassName1;
for (i=0;i {
this.AllNodes[i].className==this.ClassName2?"":this.AllNodes[i].className=sClsName;
}
}
}
HTML
a,a:visited {}{color:#000;background:inherit;}
body {}{margin:0;padding:20px;font:12px tahoma,宋体,sans-serif;}
dt {}{font-size:22px;font-weight:bold;margin:0 0 0 15px;}
dd {}{margin:0 0 0 15px;}
h4 {}{margin:0;padding:0;font-size:18px;text-align:center;}
p {}{margin:0;padding:0 0 0 18px;}
p a,p a:visited {}{color:#00f;background:inherit;}
/**//*CNLTreeMenu Start*/
.CNLTreeMenu img.s {}{cursor:pointer;vertical-align:middle;}
.CNLTreeMenu ul {}{padding:0;}
.CNLTreeMenu li {}{list-style:none;padding:0;}
.Closed ul {}{display:none;}
.Child img.s {}{background:none;cursor:default;}
#CNLTreeMenu1 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu1 img.s {}{width:20px;height:15px;}
#CNLTreeMenu1 .Opened img.s {}{background:url(skin1/opened.gif) no-repeat 0 0;}
#CNLTreeMenu1 .Closed img.s {}{background:url(skin1/closed.gif) no-repeat 0 0;}
#CNLTreeMenu1 .Child img.s {}{background:url(skin1/child.gif) no-repeat 3px 5px;}
#CNLTreeMenu2 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu2 img.s {}{width:17px;height:15px;}
#CNLTreeMenu2 .Opened img.s {}{background:url(skin2/opened.gif) no-repeat 4px 6px;}
#CNLTreeMenu2 .Closed img.s {}{background:url(skin2/closed.gif) no-repeat 3px 6px;}
#CNLTreeMenu2 .Child img.s {}{background:url(skin2/child.gif) no-repeat 3px 5px;}
#CNLTreeMenu3 ul {}{margin:0 0 0 17px;}
#CNLTreeMenu3 img.s {}{width:34px;height:18px;}
#CNLTreeMenu3 .Opened img.s {}{background:url(skin3/opened.gif) no-repeat 0 1px;}
#CNLTreeMenu3 .Closed img.s {}{background:url(skin3/closed.gif) no-repeat 0 1px;}
#CNLTreeMenu3 .Child img.s {}{background:url(skin3/child.gif) no-repeat 13px 2px;}
/**//*CNLTreeMenu End*/
/**//*Temp CSS for View Demo*/
#CNLTreeMenu1,#CNLTreeMenu2,#CNLTreeMenu3 {}{float:left;width:249px;border:1px solid #99BEEF;background:#D2E4FC;color:inherit;margin:3px;padding:3px;}
#CNLTreeMenu1,#CNLTreeMenu2 {}{padding-bottom:15px;}
.ViewCode {}{
clear:both;
border:1px solid #FFB900;background:#FFFFCC;color:inherit;margin:3px;padding:3px;
}
.ViewCode h6 {}{color:#00f;}
JavaScript
function Ob(o){
var o=document.getElementById(o)?document.getElementById(o):o;
return o;
}
function Hd(o) {
Ob(o).style.display="none";
}
function Sw(o) {
Ob(o).style.display="";
}
function ExCls(o,a,b,n){
var o=Ob(o);
for(i=0;i
o.className=o.className==a?b:a;
}
function CNLTreeMenu(id,TagName0) {
this.id=id;
this.TagName0=TagName0==""?"li":TagName0;
this.AllNodes = Ob(this.id).getElementsByTagName(TagName0);
this.InitCss = function (ClassName0,ClassName1,ClassName2,ImgUrl) {
this.ClassName0=ClassName0;
this.ClassName1=ClassName1;
this.ClassName2=ClassName2;
this.ImgUrl=ImgUrl || "css/s.gif";
this.ImgBlankA ="";
this.ImgBlankB ="";
for (i=0;i
this.AllNodes[i].className==""?this.AllNodes[i].className=ClassName1:"";
this.AllNodes[i].innerHTML=(this.AllNodes[i].className==ClassName2?this.ImgBlankB:this.ImgBlankA)+this.AllNodes[i].innerHTML;
}
}
this.SetNodes = function (n) {
var sClsName=n==0?this.ClassName0:this.ClassName1;
for (i=0;i
this.AllNodes[i].className==this.ClassName2?"":this.AllNodes[i].className=sClsName;
}
}
}
HTML
JavaScript+CSS无限极分类代码
豆瓣Javascript代码风格规范
优化你的CSS代码~
CSS鼠标样式代码大全
文字排版CSS代码知识。
JavaScript下的css属性可是大小写敏感的
CSS调试技巧五则,兼谈“提问的艺术” - CSS,Javascript,jQuery,视...
CSS调试技巧五则,兼谈“提问的艺术” - CSS,Javascript,jQuery,视...
高效整洁CSS代码原则 (上)
导航条代码 css下拉菜单
日志分类模块代码
个体经营分类与代码
如何用FIDDLER2直接调试线上页面的JavaScript和CSS
回答读者提问(19)——再谈浏览器的兼容性 - CSS,Javascript,jQuery...
实用和常用类JavaScript代码(1-5)
动态切换图片的JavaScript的代码1
CSS
css
个体经营分类与代码-510
CSS边框属性(Border)-CSS教程 网页教程与代码演示 站长书库 中国站长站 bo...
CSS间隙属性(padding)-CSS教程 网页教程与代码演示 站长书库 中国站长站 b...
【博文】剖析一个CSS投影滤镜的代码
DIV+CSS最常用的网页布局代码11例
精简的css圆角边框代码 | fanmoo结合能