1 <body> 2 <div id ="box" style="width: 100px;height: 100px;background: #b2ff5b;position:absolute;left: 0;"></div> 3 <script> 4 var box = document.getElementById('box'); 5 box.addEventListener('click',function () { 6 var left = parseInt(getStyle(box,'left')) 7 var endLeft = left + 200
div每点击一次 向右移动200px(带DOM动画过渡)
最新推荐文章于 2023-02-07 11:19:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)