我使用的是IE-11,我有一个自动加载到我的表单中的模态。它不尊重onClick()。此外,数据切换不起作用。它也会自动加载。
<form ...>
<div id="manage" class="tab-pane">
<div id="media_action_div">
<button type="button" class="btn btn-primary btn-lg media_action_buttons" id="tag_media" disabled="disabled" data-toggle="modal" data-target="#tag_media_modal">Tag</button>
<button type="button" class="btn btn-danger media_action_buttons" id="delete_media" disabled="disabled">Delete</button>
<button type="button" class="btn btn-success media_action_buttons" id="activate_media" disabled="disabled">Activate</button>
<button type="button" class="btn btn-warning media_action_buttons" id="deactivate_media" disabled="disabled">Deactivate</button>
<button type="button" class="btn btn-default media_action_buttons" id="download_media" disabled="disabled">Download</button>
</div>
</div>
</form>
这是我的模式:
<!-- Modal HTML -->
<div id="media_delete_confirmation" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p>What would you like to do?</p>
<p class="text-warning"><small>"Delete" will remove the media.</small></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary media_delete_footer" data-dismiss="modal">Keep</button>
<button type="button" class="btn btn-default media_delete_footer" id="modal_delete" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
这是我简单的JS:
$("#delete_media").click(function(){
$("#media_delete_confirmation").modal('show');
});
这是我的&#34;标签&#34;按钮:
<!-- Modal HTML -->
<div id="tag_media_modal" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Tag</h4>
</div>
<div class="modal-body">
<div class="container">
<?php
echo $PARSER->search(array(
'search' => $PARSER->student,
'actions' => '<button name="action" value="Upload" class="btn">Search</button>'
));
?>
</div>
<?php echo $PARSER->form_upload->Html(); ?>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
试试此代码
$(document).ready(function(){
$("#media_delete_confirmation").hide();
$("#delete_media").click(function(){
$("#media_delete_confirmation").show();
});
})