0
나는 다음과 같은 코드를 보내고 있습니다 :특정 ID 또는 클래스가있는 colorbox를 여는 방법은 무엇입니까?
<div class="hidden">
<div id="deletePopContent" class="c-popup">
<h2 class="c-popup-header">Delete Practice Sheet</h2>
<div class="c-content">
<h3>Are you sure to delete this practice sheet?</h3>
<p class="alert"><strong>You are about to perform an action which can't be undone</strong></p>
<a href="#"class="c-btn">No</a><a href="#"class="c-btn" id="delete_url">Delete</a>
</div>
</div>
</div>
당신처럼,
href
속성을 사용할 필요가
$(document).ready(function(){
$(document).on('click', '.edit_user_transaction_status', function (e) {
e.preventDefault();
$.colorbox.close();
//for confirmation that status change
var ans=confirm("Are you sure to change status?");
if(!ans) {
return false;
}
var post_url = $(this).attr('value');
var transaction_status_update = $('#transaction_status_update').val();
$.ajax({
type: "POST",
url: post_url+"&transaction_status_update="+transaction_status_update,
data:$('#transaction_form').serialize(),
dataType: 'json',
success: function(data) {
var error = data.login_error;
$(".ui-widget-content").dialog("close");
//This variables use for display title and success massage of transaction update
var dialog_title = data.title;
var dialog_message = data.success_massage;
//This get link where want to rerdirect
var redirect_link = data.href;
alert(redirect_link);
/*var $dialog = $("<div class='ui-state-success'></div>")
.html("<p class='ui-state-error-success'>"+dialog_message+"</p>")
.dialog({
autoOpen: false,
modal:true,
title: dialog_title,
width: 500,
height: 80,
close: function(){
document.location.href =redirect_link;
}
});*/
/*$dialog.dialog('open');*/
document.location.href =redirect_link;
$.colorbox({inline:true, width:666});
}
});
});
});
: 귀하의 트릭 확실히 나를 위해 일했다. 그러나 이제 새로운 이슈가 생겨났습니다. 팝업은 1 초 이내에 자동으로 닫히고 닫힙니다. 사용자가 닫기 버튼을 클릭 할 때까지 colorbox 팝업이 있어야하므로이 문제에 대한 해결책을 제공해 줄 수 있습니까? – PHPLover
@JSLover 내 대답을 참조하십시오 .. 그것이 도움이되기를 바랍니다 –
: 고마워,이 트릭도 나를 위해 일했다. 그러나 이제는 하나의 작은 문제가 여전히 남아 있습니다. 변수 redirect_link에 포함 된 URL을 어떻게 열어야합니까? 업데이트가 완료된 후 해당 URL의 페이지로 URL을 리디렉션하고 싶습니다. colorbox 팝업은 실제로 성공 메시지 만 표시하기위한 것입니다. – PHPLover