JS 自动更换背景

时间:2015/12/3 22:43:00来源:互联网 作者:flyso 点击: 1324 次
<html>
<script>  
var aaa=['1.jpg','2.jpg','3.jpg'];  
var count = 0;  
function on_load(){        
document.body.style.background="url("+aaa[count]+")";    
if (++count == aaa.length){      
count = 0;    }  }  
setInterval("on_load()",1000);  
</script>
<body>

</body>
</html>         


Copyright © 2005 - 2016 flyso.cn. 飞搜 版权所有 鄂ICP备11002783号-3