jQuery click won't work with new infinite scroll elements

后端 未结 2 729
一生所求
一生所求 2021-01-28 03:19

On my page, I have a list with items and you can click on a \"View More\" button which shows you more information about this topic. This click function is in jQuery on an other

相关标签:
2条回答
  • 2021-01-28 03:58

    try

    $(document).on("click",".click-job-viewmore",function(e) {});
    

    Because you should use delegates for dynamically created objects. It will help you to attach events for future elements to be created.

    0 讨论(0)
  • 2021-01-28 04:04
    Attach the click event to the document 
    
    $(document).on('click','element' function(){}); 
    
    0 讨论(0)
提交回复
热议问题