使用事件委托

$(document).on('click','selector',function(){  
        ...  
    }); 

示例

   $(document).on("click", ".Inverse", function () {
        $(this).toggleClass("current");
    
    })

将事件冒泡到document上,当检测到事件的target时,触发事件

 

相关文章:

  • 2022-12-23
  • 2021-09-25
  • 2022-01-02
  • 2021-08-02
  • 2021-07-24
  • 2021-11-19
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-07-10
  • 2021-07-20
相关资源
相似解决方案