jQuery bind efficiency

前端 未结 4 868
说谎
说谎 2021-02-01 22:01

I\'m having issue with load speed using multiple jQuery binds on a couple thousands elements and inputs, is there a more efficient way of doing this?

The site has the

4条回答
  •  梦谈多话
    2021-02-01 22:46

    Bind your click event to the entire document, and within the function, look at event.target to see which product element was actually clicked on. This way you only need to do a single bind.

提交回复
热议问题