How to hide the bootstrap model: first introduce the file environment of boostrap and Jquery; then add a large div; finally hide the modal box by setting the "aria-hidden" attribute.
The operating environment of this tutorial: Windows 7 system, bootstrap version 3. This method is suitable for all brands of computers.
Recommended: "bootstrap video tutorial"
About boostrap’s modal hidden problem (front-end framework)
First, introduce the file environment of boostrap and Jquery:
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
Usually a button or link triggers the modal
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">开始演示模态框</button><!-- 模态框(Modal) -->
First add a large div, fade: fade in and fade out effect aria- hidden is to hide the modal box
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")
Then under modal-content, insert modal-header, modal-body, modal-footer
<div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">模态框(Modal)标题</h4> </div> <div class="modal-body">在这里添加一些文本</div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary">提交更改</button> </div> </div><!-- /.modal-content -->
× which is the symbol of X, Click Close or x or click "Ese" to exit the modal box
If you want to click to submit changes and exit the modal box, you can add an onclick event and add $ in the script ("#myModal").modal("hide"); as follows
<button type="button" class="btn btn-primary" onclick="user_del()" id="user-change">提交更改</button>
function user_del(){ $("#user").modal('hide'); }
The above is the exit function problem. As for the pop-up modal box, you can write a series of form-groups in the modal-body. Input box group, for details, please go to boostrap's official website to view the input box group. The code effect is as follows:
The above is the detailed content of Regarding the hidden problem of bootstrap model. For more information, please follow other related articles on the PHP Chinese website!