0
다른 함수 onclick 이벤트 내에서 멋진 팝업을 표시하고 싶습니다. 이 함수에는 조건문이 있고 false이면 팝업이 표시되어야합니다. 나는 내가 뭘하려고 오전 보여줍니다 이는 jsfiddle을 만든다른 함수 내에서 magnificPopUp 호출
: http://jsfiddle.net/Lilu/heM4q/
HTML :
<button class="add-wishlist"><span>Wishlist</span></button>
JQuery와 : 어떤 도움이 크게 감사합니다
$(document).on('click', '.add-wishlist', function(e) {
var yes = "1";
if (yes == "2"){
// Add to wishlist
}else {
// Display error in popup
$.magnificPopup.open({
type: 'ajax',
alignTop: true,
mainClass: 'my-mfp-zoom-in',
removalDelay: 160,
callbacks: {
parseAjax: function(mfpResponse) {
mfpResponse.data = "<div class='modal-content'>"+"Sorry you cannot do that"+"</div>";
},
ajaxContentAdded: function() {
return this.content;
}
}
});
}
});
.
http://jsfiddle.net/Lilu/heM4q/4/ 당신이 팝업 표시 얻을시겠습니까. –
예. 그러나 그 진술이 거짓 일 때만. –