显示四张图片而不是一张
请问一下,如何打开显示四张图片,然后每次却换一张
请问一下,如何打开显示四张图片,然后每次却换一张
2016-08-08
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#ab{ width:100%; height:600px;position:absolute;}
#ba{ width:600px; height:500px; border:1px solid rgba(102,153,153,1); margin:0 auto;
position:relative; margin-top:100px; overflow:hidden}
#baa{ width:2400px; height:500px;position:relative;}
img{ width:600px; height:500px;float:left;}
</style>
</head>
<body>
<div id="ab">
<div id="ba">
<div id="baa">
<img src="1.jpg">
<img src="2.jpg">
<img src="3.jpg">
<img src="4.jpg">
</div>
</div>
</div>
<script>
var baa=document.getElementById("baa")
function aa(){
if(baa.offsetLeft<-1750){
baa.style.left="0px";
setTimeout(aa,2000)
}else{
baa.style.left=baa.offsetLeft-100+"px";
//setTimeout(aa,100)
if(baa.offsetLeft%600==0){
setTimeout(aa,2000) }
else{setTimeout(aa,100)}
}
}
setTimeout(aa,2000)
</script>
</body>
</html>
举报