核心js代码
<script> var box = document.querySelector('#box'); var slide = document.querySelector('.slide'); var arraw = document.querySelector('.arraw'); var lis = document.querySelectorAll('li'); var json = [ // 包含了5张图片里面所有的样式 { // 1 width:400, top:20, left:100, opacity:20, z:2, id:1 }, { // 2 width:600, top:70, left:50, opacity:60, z:3, id:2 }, { // 3 width:800, top:100, left:200, opacity:100, z:4, id:3 }, { // 4 width:600, top:70, left:550, opacity:60, z:3, id:4 }, { //5 width:400, top:20, left:650, opacity:20, z:2, id:5 } ]; </script>