As the title states, I'd like to add a checkbox to my modal that, when selected, will stop the modal from popping up. 我希望每次重新加载页面时都会出现模式,用户可以选择使其停止出现。
我的模态:
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<div id="modalText"></div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
和我的js:
<script type="text/javascript">
$(document).ready(function () {
$('.redBox').draggable();
$('.blueBox').droppable({
drop: function (event, ui) {
var draggable = ui.draggable;
var droppable = $(this).attr('id');
$(this)
$('.modal-body #modalText').append("Assign " + draggable.attr('id').substring(1, 23) + " to " + droppable + "?");
$("#myModal").modal('show');
}
});
});
</script>