日期:2014-05-17 浏览次数:20515 次
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
div {
margin:0 auto;
width:800px; /*1320*/
height:513px;
background:url(http://whoisleon.com/wp-content/themes/whoisleon/images/n_cloud1.jpg) repeat-x;
}
</style>
</head>
<body>
<div id="test"></div>
<script>
var $ = function(id){
return document.getElementById(id);
};
var obj = $('test');
var i = 0;
setInterval(function(){
obj.style.backgroundPosition = (--i)+'px';
}, 30)
</script>
</body>
</html>
------解决方案--------------------
主要是这张图做得好,移动的时候 看上去就感觉是 连绵不断的。。。。
------解决方案--------------------
css sprite
http://baike.baidu.com/view/2173476.htm