jquery 중지 전파 문제가 있습니다. 내가 카트 모달 제외하고 페이지를 클릭하면 은 카트 모달을 닫으려면, 내가해야 할 일을했을 :자식 이벤트에 대한 이벤트 중지 전파 문제
$('html').click(function() {
$('.cart-block').css('display','none');
});
$('.mycart, .cart-block').click(function(event){
event.stopPropagation();
});
을하지만 난이 문제가, 내가 (내 카트 DIV 내에서 항목을 삭제하는 AJAX 호출이 카트 블록) 정지 전파는 이벤트를 중지합니다.
$(document).on('click', '.deleteItem', function() {
//ajax call
});
나를 도와 줄 사람이 있습니까? 덕분에 많은 (내 영어 죄송합니다)
편집 : HTML 구조
<div class="center cart mycart" >
//icon and cart item counter
</div>
<div id="cartcaption" class="cart-block">
//modal : content of the cart
<div class="productsPanier">
<span id="{{$cart->rowId}}" class="deleteItem">delete</span>
</div>
</div>
HTML 구조를 보여 주시겠습니까? – 4castle
예, 게시물을 업데이트했습니다. 감사합니다. – Alexandre