Jquery click event lost response

problem description

made a small feature and found that the click event will not respond when the mouse clicks too fast.

the environmental background of the problems and what methods you have tried

at first, I thought it was the cause of the event bubbling, but it was still the same after canceling the bubbling, so I was confused. no, no, no.

related codes

/ * this method has a bug:
mouse that cannot be clicked too fast. If the mouse clicks faster than about 0.8s, it will lose its response
* /
(function () {

var url=[
    "./images/bg-4.jpg",
    "./images/bg-5.jpg",
    "./images/bg-6.jpg",
    "./images/bg-7.jpg"
]//
//
$(".thumbnail-wrap").click(function () {
    console.log("");
    //
    $(this).css("background-color","red").siblings().css("background-color","white");
    // 
    var index=$(this).index();
    console.log(":"+index);
    $(".img-content").css("background-image","url("+url[index]+")");
})

}) ()

what result do you expect? What is the error message actually seen?

later I thought it might be that the system clicked too fast and the system decided to double-click, but I was not familiar with the double-click event and didn"t know how to cancel it, so I rolled over to ask for help. -

May.24,2021

test address, http://jsrun.net/JjgKp/edit

I don't reproduce your problem here, you try it in an online editor. Send the address if you can reproduce it.

I guess DOM has been changed


IPADMACchrome300msbug
Menu