<!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>
</head>
<style>
*{ margin:0; padding:0;}
ul{ list-style:none;}
#box {
height:70px;
width:360px;
padding-top:360px;
border:1px solid #ccc;
background: url(images/01big.jpg) no-repeat;
overflow:hidden;
margin:100px auto;
}
#box ul{
overflow:hidden;
border-top:1px solid #ccc;
}
#box li{
float:left;
}
</style>
<script>
window.onload = function(){
var box = document.getElementById('box');
function fn(bg){
var lis = box.getElementsByTagName('li');
for( var i = 0; i<lis.length; i++){
lis[i].onmouseover = function(){
box.style.backgroundImage = bg;
}
}
}
fn('url(images/01big.jpg)');
fn('url(images/02big.jpg)');
fn('url(images/03big.jpg)');
fn('url(images/04big.jpg)');
fn('url(images/05big.jpg)');
}
</script>
<body>
<div id="box">
<ul>
<li><img src="images/01.jpg" alt="" /></li>
<li><img src="images/02.jpg" alt="" /></li>
<li><img src="images/03.jpg" alt="" /></li>
<li><img src="images/04.jpg" alt="" /></li>
<li><img src="images/05.jpg" alt="" /></li>
</ul>
</div>
</body>
</html>
OlderSkee
OlderSkee
相关分类