原生JS编写兼容IE6,7,8浏览器无缝自动轮播(带按钮切换)


项目要求页面兼容IE6,7,8等浏览器,我们可能会遇到这个轮播效果,轮播板块要求:无限循环、自动轮播和手动切换功能,每一次滚动一小格,网上有很多这类插件,例如:swiper等!

但是很多都是不兼容IE6,7,8这些低级浏览器的,没有办法,只能自己写一个类似的轮播插件

废话不多说,直接上代码

 1 
 2 
 3     
 4         "UTF-8">
 5         
 6         
 7         
14     
15     
16         
17
    18
  • "background: red;">1
  • 19
  • "background: yellow;">2
  • 20
  • "background: blue;">3
  • 21
  • "background: black;">4
  • 22
  • "background: green;">5
  • 23
  • "background: orange;">6
  • 24
  • "background: skyblue;">7
  • 25
  • "background: blue;">8
  • 26
  • "background: green;">9
  • 27
  • "background: orange;">10
  • 28
  • "background: skyblue;">11
  • 29
30 "javascript:void(0)" class="prev" style="left:0px;">← 31 "javascript:void(0)" class="next" style="right:0px;">→ 32
33 34 85

希望这篇文章能帮到大家,喜欢技术交流的可以关注我,一起交流前端技术。