我创建了一个Bootstrap 3模式,希望替换默认的JavaScript对话框。并且确认按钮必须触发JavaScript操作。
<div id="credits" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header margin-b-25">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h6 class="modal-title">This is a modal</h6>
</div>
<div class="modal-body center">
<p><b>modal</b></br>
Do you want accept?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-sm" data-dismiss="modal">Go!</button>
</div>
</div>
</div>
</div>
和JavaScript:
<script type="text/javascript">
$('#unblock').click(function(){
if(confirm('Are you sure that you want to accept?')){
$('#mcd, #unblock, #unblock_whole').hide();
$('#sendbtn, #quick_txt').show();
}
return false;
});
</script>
可以做到吗?