let arr=[1,23,4,5,6,7,21,0];
function between(a,b){
    return function(v){
        return v>=a && v<=b;
    }
}
console.log(arr.filter(between(0,9)));
<button>后盾人</button>
<button>后盾人1</button>
</body>
<style>
    button{
        position:absolute;
    }
</style>

let bind=false;
let btns=document.querySelectorAll("button");
btns.forEach(function(item){
    item.addEventListener("click",function(){
        if(!bind){
           let left=1;
        //    bind =true;
          bind= setInterval(function(){
            item.style.left=(left++) + "px";
        },100);

        }
    })
});

 

posted on 2022-01-20 23:04  weakup  阅读(24)  评论(0编辑  收藏  举报