0
fancybox를 사용하여 팝업을 만들고 있습니다. fancybox 안에는 버튼이 추가되어 있습니다. 사용자가 해당 버튼을 클릭 할 때 어떤 일이 발생하기를 원합니다. 다음 스크립트를 사용하려고했습니다 :fancybox에서 이벤트를 추적하는 방법
function openNotification(message) {
var popup_top = "<div class = 'popup_top'></div>";
var popup_bottom = "<div class = 'popup_bottom'></div>";
var closeBtnDiv = '<div class="popupBtnContainer"><button class="popupCloseBtn">Close</button></div>';
$.fancybox.open({
padding: 0,
content: message
});
$('.fancybox-skin').prepend(popup_top);
$('.fancybox-skin').append(popup_bottom);
$('.fancybox-outer').append(closeBtnDiv);
}
$('.popupCloseBtn').click(function(){
$.fancybox.close();
});
그러나 작동하지 않습니다. Chrome 디버거에서 이벤트가 실행되지 않음을 알 수 있습니다.
아무도 도와 줄 수 있습니까?
를 교체하십시오! 고맙습니다!! :) – yogev
@yogev :'document' 객체를 초월하지 않고도'afterShow' 콜백 내'.popupCloseBtn' 셀렉터에'click' 이벤트를 바인딩 할 수 있습니다 – JFK
afterShow 콜백은 무엇입니까? 예를 부탁해 주시겠습니까? – yogev