jQuery click event for document but ignore a div

前端 未结 1 1944
星月不相逢
星月不相逢 2021-01-05 04:02

I have a online Slide Show I\'m working on using jQuery. I have use $(document).click event to detect when a user clicks on the page to know when to show the next bullet poi

1条回答
  •  离开以前
    2021-01-05 04:44

    You will most likely need to stop the propagation of events in your Comments div using the event object's stopPropagation() method:

    $('#comments').click(function(e) {
      e.stopPropagation();
    });
    

    if that doesn't work try using preventDefault():

    e.preventDefault();
    

    0 讨论(0)
提交回复
热议问题