I'm using this code:
$(".heading.media").click(function (event) {
$("#cart").toggleClass("active");
$('#cart').load('index.php?route=module/cart #cart > *');
});
But for some reason the .toggleClass("active")
isn't working. It opens but I can't toggle after that.
When I remove $('#cart').load('index.php?route=module/cart #cart > *');
it works just fine.
Why does $('#cart').load('index.php?route=module/cart #cart > *');
cause trouble ?
Try selecting the element by event delegation method and try.
$(document).on('click', '.heading.media', function (event) {
$("#cart").toggleClass("active");
$('#cart').load('index.php?route=module/cart #cart > *');
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다