首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

哪位高手来帮小弟我看上这个JS代码

2013-01-06 
谁来帮我看下这个JS代码link hrefcss/erjiye.css relstylesheet typetext/css /script type

谁来帮我看下这个JS代码



<link href="css/erjiye.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">    function getObject(objectId) {
        if (document.getElementById && document.getElementById
(objectId)) { return document.getElementById(objectId); } else if (document.all && document.all(objectId)) {
            return
            document.all(objectId);
        } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else {
            return false;
        } 
    } function showHide(e, objname) {
        var obj = getObject(objname); if (obj.style.display == "none") {
            obj.style.display = "block"; e.className = "minus";
        } else { obj.style.display = "none"; e.className = "plus"; } 
    } </script> 

<div class="memberl">
     <div class="lborder"> 
<div class="nav_menu"> 
 <div class="yjcd">配饰</div> 
   <dl> 
     <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items120');"><span></span><a href="#">服饰配件</a></a></dt>
       <dd id="items120" style="display:none;">
          <ul>
             <li><a href="#">围巾丝巾</a></li>
             <li><a href="#">围巾、丝巾、披肩</a></li>
          </ul>
       </dd>
   </dl>
   <dl> 
     <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items119');"><span></span><a href="#">潮流饰品</a></a></dt>
        <dd id="items119" style="display:none;">
          <ul>
            <li><a href="#">耳饰</a></li> 
            <li><a href="#">假发</a></li>
          </ul>
        </dd>
    </dl> 
  <div class="yjcd">服装</div> 
     <dl> 


       <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items118');"><span></span><a href="#">时尚男装</a></a></dt>
         <dd id="items118" style="display:none;">
           <ul>  
             <li><a href="#">男时尚衬衫</a></li>
           </ul>
         </dd>
      </dl>
      <dl>
        <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items117');"><span></span><a href="#">潮流女装</a></a></dt>
          <dd id="items117" style="display:none;">
            <ul>
               <li><a href="#">职业裤装</a></li>
            </ul>
          </dd>
      </dl> 
</div>
</div></div>



css/erjiye.css

/*左侧菜单样式*/

*{margin:0;padding:0;list-style-type:none;} 
a,img{border:0;} 
a{color:#5e5e5e;font-size:14px;text-decoration:none;} 
a:hover{color:#3366cc;text-decoration:underline;} 
.nav_menu{width:180px;margin:0px auto;}
.nav_menu dl{background:url(../images/verline.gif) no-repeat 0px 0; margin-left:12px;} 
.nav_menu dl dt a{height:26px;line-height:26px;overflow:hidden;color:#5e5e5e;font-weight:800;} 
.nav_menu dl dt a span{display:inline-block;width:13px;height:20px;overflow:hidden;float:left;margin:0 5px 0 0;} 
.nav_menu dl dt a.minus span{background:url(../images/showbtn.gif) no-repeat left center;} 
.nav_menu dl dt a.plus span{background:url(../images/hidebtn.gif) no-repeat left center;} 
.nav_menu dl dd li{height:26px;line-height:26px;padding:0 0 0 18px} 
.yjcd{ width:100%; margin:0 auto; background:url(../images/hidebtn1.gif) no-repeat left center; color:#333;padding-left:20px; font-weight:bold; font-size:14px;}

.zxr{ width:100%; margin:0 auto; font-size:12px; line-height:30px; border-top:1px dashed #CCC; text-align:right; margin-top:12px;}

.cp{ position:relative;width:985px; margin:0 auto; border:1px solid #eeeeee; margin-top:10px; padding:5px;}
.cp span{ position:absolute; width:100px; right:10px; vertical-align:middle; text-align:right;}
.zhifb{ background:#fffbe1; border-bottom:1px dashed #febf90; width:100%; min-height:64px; padding:20px 10px 0px; vertical-align:middle;}
.wangyin{ width:100%; margin:0 auto;}
.wangyin ul{ list-style:none;margin:0 auto;}
.wangyin ul li{width:230px; float:left; margin-left:15px; margin-bottom:15px;}
.bordercs{ border-bottom:1px dashed #fdbf90; width:100%;}




images文件夹下图片
hidebtn.gif
哪位高手来帮小弟我看上这个JS代码
showbtn.gif
哪位高手来帮小弟我看上这个JS代码
hidebtn1.gif
哪位高手来帮小弟我看上这个JS代码

alt="哪位高手来帮小弟我看上这个JS代码" />

[解决办法]
<style>
/*左侧菜单样式*/
 
*{margin:0;padding:0;list-style-type:none;} 
a,img{border:0;} 
a{color:#5e5e5e;font-size:14px;text-decoration:none;} 
a:hover{color:#3366cc;text-decoration:underline;} 
.nav_menu{width:180px;margin:0px auto;}
.nav_menu dl{background:url(verline.gif) no-repeat 0px 0; margin-left:12px;} 
.nav_menu dl dt a{height:26px;line-height:26px;overflow:hidden;color:#5e5e5e;font-weight:800;} 
.nav_menu dl dt a span{display:inline-block;width:13px;height:20px;overflow:hidden;float:left;margin:0 5px 0 0;} 
.nav_menu dl dt a.minus span{background:url(showbtn.gif) no-repeat left center;} 
.nav_menu dl dt a.plus span{background:url(hidebtn.gif) no-repeat left center;} 
.nav_menu dl dd li{height:26px;line-height:26px;padding:0 0 0 18px} 
.yjcd{ width:100%; margin:0 auto; background:url(hidebtn1.gif) no-repeat left center; color:#333;padding-left:20px; font-weight:bold; font-size:14px;}
 
.zxr{ width:100%; margin:0 auto; font-size:12px; line-height:30px; border-top:1px dashed #CCC; text-align:right; margin-top:12px;}
 
.cp{ position:relative;width:985px; margin:0 auto; border:1px solid #eeeeee; margin-top:10px; padding:5px;}
.cp span{ position:absolute; width:100px; right:10px; vertical-align:middle; text-align:right;}
.zhifb{ background:#fffbe1; border-bottom:1px dashed #febf90; width:100%; min-height:64px; padding:20px 10px 0px; vertical-align:middle;}
.wangyin{ width:100%; margin:0 auto;}
.wangyin ul{ list-style:none;margin:0 auto;}
.wangyin ul li{width:230px; float:left; margin-left:15px; margin-bottom:15px;}
.bordercs{ border-bottom:1px dashed #fdbf90; width:100%;}
</style>
 
<script type="text/javascript">
    function getObject(objectId) {
        if (document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId); }
        else if (document.all && document.all(objectId)) {
            return document.all(objectId);
        } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else {
            return false;
        }
    }
    function showHide(e, objname) {
        var obj = getObject(objname); if (obj.style.display == "none") {


            obj.style.display = "block"; e.className = "minus";
        } else { obj.style.display = "none"; e.className = "plus"; }
    }
    function rootClick(dv) {
        var img = dv.getElementsByTagName('img')[0], exp = img.src.indexOf('hidebtn.gif') != -1;
        img.src = exp ? 'showbtn.gif' : 'hidebtn.gif';
        while (dv = dv.nextSibling) {
            if (dv.nodeType == 3) continue;//非IE下的空白节点忽略
            if (dv.className == 'yjcd') break;
            dv.style.display = exp ? 'block' : 'none';
        }

    }
    </script> 
 
<div class="memberl">
     <div class="lborder"> 
<div class="nav_menu"> 
 <div class="yjcd" onclick="rootClick(this)"><img src="hidebtn.gif" />配饰</div> 
   <dl style="display:none"> 
     <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items120');"><span></span><a href="#">服饰配件</a></a></dt>
       <dd id="items120" style="display:none;">
          <ul>
             <li><a href="#">围巾丝巾</a></li>
             <li><a href="#">围巾、丝巾、披肩</a></li>
          </ul>
       </dd>
   </dl>
   <dl style="display:none"> 
     <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items119');"><span></span><a href="#">潮流饰品</a></a></dt>
        <dd id="items119" style="display:none;">
          <ul>
            <li><a href="#">耳饰</a></li> 
            <li><a href="#">假发</a></li>
          </ul>
        </dd>
    </dl> 
  <div class="yjcd" onclick="rootClick(this)"><img src="hidebtn.gif" />服装</div> 
     <dl style="display:none"> 
       <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items118');"><span></span><a href="#">时尚男装</a></a></dt>
         <dd id="items118" style="display:none;">


           <ul>  
             <li><a href="#">男时尚衬衫</a></li>
           </ul>
         </dd>
      </dl>
      <dl style="display:none">
        <dt><a href="javascript:void(0);" class="plus" onClick="showHide(this,'items117');"><span></span><a href="#">潮流女装</a></a></dt>
          <dd id="items117" style="display:none;">
            <ul>
               <li><a href="#">职业裤装</a></li>
            </ul>
          </dd>
      </dl> 
</div>
</div></div>

热点排行