how to prevent the click event of the parent when its children is being dragged
问题 Here is a sample code: $('.bmc-div').click(function(e){ e.stopPropagation(); // console.log(e.target); if ($(e.target).hasClass('my-sticky')) { } else { canvas.add_sticky($(this)); } }); $('.bmc-div .sticky_container').sortable({ cursor: 'move', revert: true, helper: 'clone', // handle: ".element-handler", connectWith: '.bmc-div .sticky_container', scroll: true, cancel: null, opacity: 0.7, // axis: 'y', items: ".my-sticky", placeholder : "sticky-placeholder", containment: "#main", zIndex: