效果出不来,求救!

huijunliang 2012-01-16 04:53:05
效果图:




代码:




<!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>





显示的图片是错位的。。求解!!!
...全文
124 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
myleihao_88 2012-01-16
  • 打赏
  • 举报
回复
如果只是图片错位,最大的可能就是css的问题,仔细检查一下css
滴滴月空雨 2012-01-16
  • 打赏
  • 举报
回复
#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;
}
夜风插画 2012-01-16
  • 打赏
  • 举报
回复
用简单的CSS,加上精确的JS灵活赋值,都不难实现
huijunliang 2012-01-16
  • 打赏
  • 举报
回复


zsx841021

不行,我弄2天了
三石-gary 2012-01-16
  • 打赏
  • 举报
回复
你的代码本来就能实现你要的效果啊。。。。自己把代码整理整理。。。
三石-gary 2012-01-16
  • 打赏
  • 举报
回复

<!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: 15px;
}
</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>
滴滴月空雨 2012-01-16
  • 打赏
  • 举报
回复

<!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 = 1;
function show_king_list(e,k)
{

if(show_king_id == k) return true;
o = document.getElementById("a"+show_king_id);
o.className = "bg";
e.className = " ";
show_king_id = k;
}
var show_kinga_id = 1;
function show_kinga_list(f,l)
{
if(show_kinga_id == l) return true;
o = document.getElementById("b"+show_kinga_id);
o.className = "bg";
f.className = " ";
show_kinga_id = l;
}
</script>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
color:#666666;
}
.door_container {
width:204px; background:#fff; border:1px solid #ccc;
margin:20px auto;
}
.door_container .TabTitle {
height:30px; margin-bottom:6px;
}
.door_container .TabTitle li {
list-style:none;
float:left;
width:100px;
height:36px;
cursor:pointer;
padding-left:2px;
line-height:28px;
color:#7c7c7c;
font-size:14px;
text-align:center;
font-weight:bold;
background:#DDDDDD;
}
.door_container .TabTitle .active {
color:#0066CC;
background:#fff;
}
.door_container .TabTitle .normal {
color:#7c7c7c;
}
.door_container .TabContent {
width:198px; background:#fff; padding:3px;
}
.none {
display: none;
}
.star{
width:198px;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.star dl{
width:198px;
margin:2px 0;
float:left;
}
.star dl dd{
float:left;
margin-left:8px;
line-height:18px;
}
.star dl dt{
float:left;
}
.bg{
width:198px;
margin:2px 0;
background:#e1e1e1;
float:left;
}
.sl01{
background:#0066CC;
margin:15px 5px 0 5px;
width:25px;
height:18px;
padding-top:7px;
text-align:center;
font-weight:bold;
color:#FFF;
}
.sl02 img{
border:1px solid #999999;
padding:3px; width:50px; height:50px; display:block;
}
.sl03 a{
color:#0066CC;
text-decoration:underline;
}
.sl03 a:hover{
color:#FF0084;
text-decoration:none;
}
.sl04{
background:#CCCCCC;
}
.sl05{
color:#FF0084;
}
.bg .sl01{
background:#fff;
margin:5px 5px 0 5px;
width:25px;
height:18px;
padding-top:7px;
text-align:center;
font-weight:bold;
color:#0066CC;
}
.bg .sl02 img{
display:none;
}
.bg .sl03{
width:140px;
}
.bg .sl04{
background:#CCCCCC;
width:155px;
}
.bg .sl05{
display:none;
}
</style>
</head>
<body>
<div class="door_container">
<div class="TabContent">
<div class="star">
<dl id=a1 onmouseover=show_king_list(this,1);>
<dt class="sl01">01</dt>
<dt class="sl02"><a href="http://www.7caidy.com"><img src="/images/s1.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://www.7caidy.com">csr04</a></dd>
<dd class="sl04">24岁 浙江·杭州</dd>
<dd class="sl05">人气:987654</dd>
</dl>
<dl class=bg id=a2 onmouseover=show_king_list(this,2);>
<dt class="sl01">02</dt>
<dt class="sl02"><a href="http://www.33567.cn"><img src="/images/s2.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://www.33567.cn">User Name</a></dd>
<dd class="sl04">24岁 广东·广州</dd>
<dd class="sl05">人气:1243178</dd>
</dl>
<dl class=bg id=a3 onmouseover=show_king_list(this,3);>
<dt class="sl01">03</dt>
<dt class="sl02"><a href="http://so.7caidy.com"><img src="/images/s3.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://so.7caidy.com">User Name</a></dd>
<dd class="sl04">24岁 广东·广州</dd>
<dd class="sl05">人气:1243178</dd>
</dl>
</div>
<div class="none">
<div class="star">
<dl id=b1 onmouseover=show_kinga_list(this,1);>
<dt class="sl01">01</dt>
<dt class="sl02"><a href="http://www.CsrCode.cn"><img src="/images/s4.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://www.CsrCode.cn">User Name</a></dd>
<dd class="sl04">24岁 广东·广州</dd>
<dd class="sl05">人气:1243178</dd>
</dl>
<dl class=bg id=b2 onmouseover=show_kinga_list(this,2);>
<dt class="sl01">02</dt>
<dt class="sl02"><a href="http://sobook.33567.cn"><img src="/images/s5.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://sobook.33567.cn">User Name</a></dd>
<dd class="sl04">24岁 广东·广州</dd>
<dd class="sl05">人气:1243178</dd>
</dl>
<dl class=bg id=b3 onmouseover=show_kinga_list(this,3);>
<dt class="sl01">03</dt>
<dt class="sl02"><a href="http://changshi.csrcode.cn"><img src="/images/s6.jpg" width=50px height=50px alt="" /></a></dt>
<dd class="sl03"><a href="http://changshi.csrcode.cn">User Name</a></dd>
<dd class="sl04">24岁 广东·广州</dd>
<dd class="sl05">人气:1243178</dd>
</dl>

</div>
</div>
</div>
</div>
</body>
</html>



给你这个吧 !! 你把里面的文字改成你那样就可以了!!
huijunliang 2012-01-16
  • 打赏
  • 举报
回复
2楼的可以帮忙在改下吗?

效果是这样的:

计算机病毒教学设计 教学目标:了解计算机病毒的相关知识 教学重点:了解计算机病毒的相关知识 教学难点:将学到的知识运用到现实生活中 1. 导入 师:昨天晚上李老师接到了一个朋友的求救电话,告诉我他家里的电脑出了点问题,要 我去帮忙维修,到了他家里打开电脑一看,就发现了电脑变成这个样子了(出示课件) 师问:你觉得这台电脑正常吗?什么原因呢? 学生答:病毒。 师:有人知道这个病毒叫什么名字吗?是的,这就是电脑中了赫赫有名的病毒"熊猫烧香 "造成的样子。你知道这个病毒是谁造的?这个人叫李俊,2006的时候这个人制造了这个 病毒,由于这个病毒破坏性极大,并且给社会带来了很大的影响,2007年被判刑入狱4年 。今天我们将通过本节课的学习来研究计算机病毒。 2. 新授 1. 自学计算机病毒相关知识 请同学们打开桌面名为"计算机病毒学习"幻灯片文件进行自学,5分钟后老师将通过任意 点学号的方式抽查大家的学习效果。 2. 示范竞赛提问 师:请29号同学回答,什么是计算机病毒? 师:其实计算机病毒就是人为制造的有害程序 师:接下来我们将进行有关"计算机病毒"知识竞赛,出示课件并提出要求 3. 学生再次进行阅读学习和排练 时间约10分钟,指导学生提炼问题和答案。 4. 学生展示排练效果 师:燕山小学2014年第一届"计算机病毒知识"竞赛现在开始,接下来有请XX同学和XX同 学上台展示。 5. 思考并完成课堂练习 ----------------------- 计算机病毒教学设计(1)全文共2页,当前为第1页。 计算机病毒教学设计(1)全文共2页,当前为第2页。

61,115

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧