bootstrap model隐藏的方法:首先外引boostrap和Jquery的文件环境;然后添加一个大的div;最后通过设置“aria-hidden”属性隐藏模态框即可。

本教程操作环境:windows7系统、bootstrap3版,该方法适用于所有品牌电脑。
推荐:《bootstrap视频教程》
关于boostrap的modal隐藏问题(前端框架)
Modal(模态框)
首先,外引boostrap和Jquery的文件环境:
<link> <script></script> <script></script>
一般是按钮或者链接触发modal
<button>开始演示模态框</button><!-- 模态框(Modal) -->
首先添加一个大的div, fade:淡入淡出的效果 aria-hidden是为了隐藏模态框
<div> <p>然后在modal-content下,插入modal-header,modal-body,modal-footer</p><div class="aritcle_card flexRow artxards"> <div class="artcardd flexRow"> <a class="aritcle_card_img" rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap"><img src="https://img.php.cn/upload/skill/000/000/081/179025304626966.jpg" alt="VPS Bootstrap" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a> <div class="aritcle_card_info flexColumn"> <a rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap" class="overflowclass">VPS Bootstrap</a> <p class="overflowclass">从零启动全新 VPS,完成 OpenClaw 完整部署,包括备份/恢复及恢复后验证。用于 OpenClaw 部署。</p> </div> <a rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a> </div> </div> <pre class="brush:php;toolbar:false"><div> <div> <button>×</button> <h4>模态框(Modal)标题</h4> </div> <div>在这里添加一些文本</div> <div> <button>关闭</button> <button>提交更改</button> </div> </div><!-- /.modal-content -->
×就是X的符号,点击关闭或者x或者点“Ese”都可以退出模态框
如果,你想点击提交更改也可以退出模态框,你可以添加一个onclick事件,在script里添加$("#myModal").modal("hide");如下
<button>提交更改</button>
function user_del(){
$("#user").modal('hide');
}
以上就是退出功能问题,至于弹出的模态框,可以在modal-body里写入一系列的form-group,输入框组,详情进入boostrap的官网查看输入框组的学习即可,代码效果如下:











