<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
/*overflow:hidden的作用是隐藏溢出,超出设置的宽高后自动隐藏*/
#tab { overflow:hidden; position:relative; float:left;}
/*img里面的第一个元素外的元素都设置为*/
#tab>img:not(:first-child){ display:none; }
 
</style>
<script>
    window.onload = function(){
     
        var images = document.getElementsByTagName('img');
        console.log(images)
        var pos = 0;
        var len = images.length;
         
        setInterval(function(){
         
            images[pos].style.display = 'none';
            pos = ++pos == len ? 0 : pos;
            images[pos].style.display = 'inline';
         
        },1000);
         
    };
</script>
 
</head>
 
<body>
<div />
</div>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-07-08
猜你喜欢
  • 2021-07-07
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-11-27
  • 2021-07-29
相关资源
相似解决方案