移动到四个框子上
实现四张图片的切换
大致这样,不改了,懒.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
ul li{
list-style: none;
text-decoration:none;
border: solid black 1px;
background: green;
}
li:hover{
background: brown;
}
</style>
</head>
<body>
<div >
<img id="a1" src="img/梅花.jpg"/>
</div>
<ul>
<li onmouseover="bian(0)">梅</li>
<li onmouseover="bian(1)">兰</li>
<li onmouseover="bian(2)">竹</li>
<li onmouseover="bian(3)">菊</li>
</ul>
</body>
<script type="text/javascript">
var i=0;
function bian(i){
var a=document.getElementById("a1");
if(i==0)
a.setAttribute("src","img/梅花.jpg");
if(i==1)
a.setAttribute("src","img/兰花.jpg");
if(i==2)
a.setAttribute("src","img/兰花.jpg");
document.getElementById("a1");
if(i==3)
a.setAttribute("src","img/兰花.jpg");
document.getElementById("a1");
}
</script>
</html>