jquery-ui 또는 단순 모달 또는 모든 플러그인 사용을 피하려고합니다.Jquery 모달 대화 상자 확인 - 새 창이 곱합니다.
나는 외부 링크를 클릭하면 예와 아니오 버튼이 포함 된 숨겨진 div가 표시됩니다. 사용자가 예를 클릭하면 새 창으로 이동합니다.
내 문제는 사용자가 링크를 다시 클릭하면 원래 페이지로 돌아 가면 동일한 링크가 두 개의 탭으로 열리 며, 링크를 반복하면 세 개의 탭에서 열리는 등의 문제가 거의 발생합니다. 여기
$("a[href^='http:']:not([href*='" + window.location.host + "'][target='_blank'])").live('click', function (event) {
var href_ext = $(this).attr("href");
$('#overlay').fadeIn(500).css({'position':'fixed', 'top':'0px'});
$('#overlay .ok').live('click', function() {
window.open(href_ext);
$('#overlay').hide();
return false;
});
$('#overlay .close, #overlay .cancel').live('click', function() {
$('#overlay').fadeOut(500);
});
event.preventDefault();
});
..
<div id="overlay">
<div class="decoration">
<div class="overlay-content">
<a href="#" class="close">X</a>
<h1>You are now leaving the website</h1>
<p>This link will take you to a website where this Privacy Policy does not apply.</p>
<p><strong>Select OK to continue.</strong></p>
<a href="#" class="ok">OK</a>
<a href="#" class="cancel">CANCEL</a>
</div>
</div>
는 능의 링크를 클릭 할 때마다
http://jsbin.com/apekik/7