bootstrap中模态框、模态框的属性
工作中有需要用到模态框的可以看看
<p class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false"> <p class="modal-dialog"> <p class="modal-content"> <p class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="btnCancel"> × </button> <h4 class="modal-title" id="myModalLabel"> 前台菜单管理 </h4> </p> <p class="modal-body"> <p> <table width="100%" border="0" class="userCon_2"> <tr> <th width="30%">名称:</th> <td width="70%"> <input type="text" name="Name" class="form-control" style="border-radius:3px; width:220px;" id="txtName" required="" aria-required="true"> </td> </tr> <tr> <th>动作类型:</th> <td> <select class="selectpicker show-tick" id="txtType" style="height: 30px; width: 220px;" name="Type"> <option value="view">view</option> <option value="click">click</option> </select> </td> </tr> <tr> <th>路径:</th> <td> <input type="text" name="Url" class="form-control" style="border-radius:3px; width:220px;" id="txtUrl" required="" aria-required="true" /> </td> </tr> <tr> <th>排序:</th> <td> <input type="text" name="Rank" class="form-control" style="border-radius:3px; width:220px;" id="txtRank" /> <input type="hidden" name="MainMenuGuid" value="" id="txtMainMenuGuid" /> </td> </tr> </table> </p> </p> <p class="modal-footer" style="border-top:none;"> <button type="button" class="btn btn-default" data-dismiss="modal" id="btnClose">关闭</button> <button type="submit" class="btn btn-primary" id="btnSave">保存</button> </p> </p><!-- /.modal-content --> </p><!-- /.modal --> </p>
其中模态框有个属性可以避免点击遮罩层导致模态框关闭。就是p中设置的 data-backdrop="static"。这样可以避免在模态框中输入内容时突然的误操作导致模态框关闭。
另外还有一个属性:data-keyboard="false"。此举是设置按下ESC退出键无效。同样是为了避免突然的误操作导致模态框关闭。
<p id="toolbar" class="btn-group"> <button id="btn_add" type="button" class="btn btn-newAdd" data-toggle="modal" data-target="#userModal"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn btn-newAdd"> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-newAdd"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除 </button> </p>
其中按钮属性 data-toggle="modal" data-target="#userModal" 是打开模态框。
更多bootstrap中模态框、模态框的属性 相关文章请关注PHP中文网!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

如何使用 Bootstrap 获取搜索栏的值:确定搜索栏的 ID 或名称。使用 JavaScript 获取 DOM 元素。获取元素的值。执行所需的操作。

使用 Bootstrap 实现垂直居中:flexbox 法:使用 d-flex、justify-content-center 和 align-items-center 类,将元素置于 flexbox 容器内。align-items-center 类法:对于不支持 flexbox 的浏览器,使用 align-items-center 类,前提是父元素具有已定义的高度。

在 Vue.js 中使用 Bootstrap 分为五个步骤:安装 Bootstrap。在 main.js 中导入 Bootstrap。直接在模板中使用 Bootstrap 组件。可选:自定义样式。可选:使用插件。

创建 Bootstrap 分割线有两种方法:使用 标签,可创建水平分割线。使用 CSS border 属性,可创建自定义样式的分割线。

在 Bootstrap 中插入图片有以下几种方法:直接插入图片,使用 HTML 的 img 标签。使用 Bootstrap 图像组件,可以提供响应式图片和更多样式。设置图片大小,使用 img-fluid 类可以使图片自适应。设置边框,使用 img-bordered 类。设置圆角,使用 img-rounded 类。设置阴影,使用 shadow 类。调整图片大小和位置,使用 CSS 样式。使用背景图片,使用 background-image CSS 属性。

要调整 Bootstrap 中元素大小,可以使用尺寸类,具体包括:调整宽度:.col-、.w-、.mw-调整高度:.h-、.min-h-、.max-h-

要设置 Bootstrap 框架,需要按照以下步骤:1. 通过 CDN 引用 Bootstrap 文件;2. 下载文件并将其托管在自己的服务器上;3. 在 HTML 中包含 Bootstrap 文件;4. 根据需要编译 Sass/Less;5. 导入定制文件(可选)。设置完成后,即可使用 Bootstrap 的网格系统、组件和样式创建响应式网站和应用程序。

如何使用 Bootstrap 按钮?引入 Bootstrap CSS创建按钮元素并添加 Bootstrap 按钮类添加按钮文本
