【求助】网页中“鼠标一放到数字上就显示相应的图”叫做什么?球代码
哪里可以复制这样的完整代码?或者这个效果叫做什么?我去搜搜~用于dreamweaver中~~~...
哪里可以复制这样的完整代码?
或者这个效果叫做什么?我去搜搜~
用于dreamweaver中~~~ 展开
或者这个效果叫做什么?我去搜搜~
用于dreamweaver中~~~ 展开
1个回答
展开全部
这个很容易做,下面是我写出的代码,其中<img src="">双引号里面替换你自己的图片路径就可以了替换成你自己的就可以了
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<script language="javascript">
function show(op)
{
for(var i=1;i<=4;i++)
{
var DIVName=eval("apDiv"+i);
if(op==i)
{
DIVName.style.display="block";
}
else
{
DIVName.style.display="none";
}
}
}
</script>
</head>
<body>
<table width="600" border="1" height="160">
<tr>
<td width="540" rowspan="4">
<div id="apDiv1" style="height:160; width:540; display:block"><img src="images/1.bmp" /></div>
<div id="apDiv2" style="height:160; width:540; display:none"><img src="images/2.bmp" /></div>
<div id="apDiv3" style="height:160; width:540; display:none"><img src="images/3.bmp" /></div>
<div id="apDiv4" style="height:160; width:540; display:none"><img src="images/4.bmp" /></div>
</td>
<td width="44" align="center" onmouseover="show(1)"><span class="STYLE1">1</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(2)"><span class="STYLE1">2</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(3)"><span class="STYLE1">3</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(4)"><span class="STYLE1">4</span></td>
</tr>
</table>
</body>
</html>
对了,图片是540*160的
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<script language="javascript">
function show(op)
{
for(var i=1;i<=4;i++)
{
var DIVName=eval("apDiv"+i);
if(op==i)
{
DIVName.style.display="block";
}
else
{
DIVName.style.display="none";
}
}
}
</script>
</head>
<body>
<table width="600" border="1" height="160">
<tr>
<td width="540" rowspan="4">
<div id="apDiv1" style="height:160; width:540; display:block"><img src="images/1.bmp" /></div>
<div id="apDiv2" style="height:160; width:540; display:none"><img src="images/2.bmp" /></div>
<div id="apDiv3" style="height:160; width:540; display:none"><img src="images/3.bmp" /></div>
<div id="apDiv4" style="height:160; width:540; display:none"><img src="images/4.bmp" /></div>
</td>
<td width="44" align="center" onmouseover="show(1)"><span class="STYLE1">1</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(2)"><span class="STYLE1">2</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(3)"><span class="STYLE1">3</span></td>
</tr>
<tr>
<td align="center" onmouseover="show(4)"><span class="STYLE1">4</span></td>
</tr>
</table>
</body>
</html>
对了,图片是540*160的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询