日期:2014-05-17  浏览次数:20983 次

效果出不来,求救!
效果图:




代码:

HTML code



<!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">
<head>
<title>简单实用的垂直导航菜单</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
.sv3 dl,.sv3 dt,.sv3 dd{
    padding:0;
    margin:0;
}
.sv3{
    width:200px;
    border:1px solid #BFC7D9;
}
.sv3 dl{
    width:200px;
    height:380px;
    background:#fff;
    overflow:hidden;
}
.sv3 dt{
    padding:5px 10px;
    height:13px;
    font-size:13px;
    color:#000;
    background:#fff;
    border-bottom:1px dashed #ccc;
    border-top:1px dashed #ccc;
}
.sv3 dl.on dt{
    background:#fff;
    color:#000;
    font-weight:bold;
}
.sv3 dd{
    padding:10px;
    color:#333;
    font-size:12px;
    line-height:1.5em;
}
.sv3 dd a:link,
.sv3 dd a:visited,
.sv3 dd a:hover,
.sv3 dd a:active{
    color:#333;
    display:block;
    text-align:right;
}



#idSlideView3 dl dt{background-image:url

(http://hi.csdn.net/attachment/201201/15/10143223_1326660324Jm24.gif); background-

repeat:no-repeat;}

#idSlideView3 dl dt{
    padding-left:15px;
    line-height:22px;
}

</style>
</head>
<body>
<h3>简单实用的垂直导航菜单</h3>
<div id="idSlideView3" class="sv3">
  <dl class="on">
    <dt>网页特效 </dt>
    <dd> 导航菜单</dd>
  </dl>
  <dl>
    <dt> 层与布局</dt>
    <dd> 内容二 </dd>
  </dl>
  <dl>
    <dt> 表单相关</dt>
    <dd> 内容三 </dd>
  </dl>
  <dl>
    <dt> ASP源码 </dt>
    <dd> 内容四</dd>
  </dl>
  <dl>
    <dt> PHP源码 </dt>
    <dd> 内容五 </dd>
  </dl>
  <dl>
    <dt> .NET源码 </dt>
    <dd> 内容六 </dd>
  </dl>
  <dl>
    <dt> SQL数据库 </dt>
    <dd> 内容七 </dd>
  </dl>
   <dl>
    <dt> JAVA源码 </dt>
    <dd> 内容八 </dd>
  </dl>
  <dl>
    <dt> 移动开发 </dt>
    <dd> 内容九 </dd>
  </dl>
<dl>
    <dt> 技术前沿 </dt>
    <dd> 内容十 </dd>
  </dl>
</div>
<script language="javascript">
function SlideView(e){
   for(var r=document.getElementById(e).getElementsByTagName('dl'),c=clearInterval,i=-

1,p=r[0],j; j=r[++i];){
       j.style.height=(i?24:100)+'px';
       j.onmouseover=function(){clearTimeout(j);var i=this;j=setTimeout(function(){if(p!

=i)_(p,100,24)(p=i,24,100)},200)};
   }
   function _(el,f,t){
       c(el.$1);el.className=f>t?'':'on';
       return el.$1=setInterval(function(){el.style.height=(f+=Math[f>t?'floor':'ceil']

((t-f)*.3))+'px';if (f==t)c(el.$1)},10),_
   }
};
new SlideView( "idSlideView3");
</script>
</body>
</html>






显示的图片是错位的。。求解!!!

------解决方案--------------------
#idSlideView3 dl dt{background-image:url(http://hi.csdn.net/attachment/201201/15/10143223_1326660324Jm24.gif); 
background-repeat:no-repeat; background-position:5px 5px; padding-left:25px;
}
------解决方案--------------------
HTML code

<!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">
<head>
<title>【荐】JS+CSS布局的人气列表切换效果丨芯晴网页特效丨CsrCode.Cn</title>
<script type="text/javascript">
var show_king_id =