0
닫기 버튼을 하나 개의 함수닫기 버튼을
에 jQuery를 작동하지 않는 하나 개의 기능에 jQuery를 작동하지 않습니다 나는 JQuery와에서 수행 다음 모달, 나는 닫기 버튼을 클릭의 문제를 해결하기 위해 여러 가지 방법을 시도해야, 그러나 나는 그것을 작동시킬 수 없다.
의견이나 제안이 있으십니까?
LINK : http://jsfiddle.net/wx0wvh9L/이
JQUERY :이
(function($) {
$.fn.modalBox = function($custom) {
var name = "box-modal",
custom = ($custom == null) ? "" : $custom;
$(this).on('click', function(e) {
e.preventDefault();
var link = $(this).data("modal"),
iframe = '<div class="' + name + ' ' + custom + '">' +
'<iframe src="' + link + '" frameborder="0" allowfullscreen></iframe>' +
'<div class="close"></div>' +
'</div>';
$("body").append(iframe);
$("." + name).fadeIn(350);
});
$(".close").on('click', function(e) {
e.preventDefault();
$("." + name).hide();
});
};
}(jQuery));
$(".modal-video").modalBox();
HTML :
<div class="modal-video" data-modal="https://www.youtube.com/embed/P2x3-b6JEj8?rel=0&showinfo=0&autoplay=1">
Test Click
</div>