在head里面加
<script language="javascript"> function scroll(spanlevel) { if (spanlevel.style.zIndex == 0) { spanlevel.style.zIndex = 2; } else { spanlevel.style.zIndex = 0; } } setInterval("scroll(span2)", 2000); </script>
在body里面
<div id="span1" style="position: absolute; margin-top: 10px; float: left; z-index: 1;"> <img alt="" src="11.jpg" style="1266px" /> </div> <div id="span2" style="position: absolute; margin-top: 10px; float: left; z-index: 0;"> <img alt="" src="222.jpeg" style="1266px"/> </div>