bootstrap中模态框、模态框的属性
工作中有需要用到模态框的可以看看
<div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="btnCancel">
×
</button>
<h4 class="modal-title" id="myModalLabel">
前台菜单管理
</h4>
</div> <div class="modal-body">
<div> <table width="100%" border="" 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>
</div>
</div>
<div 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>
</div> </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
其中模态框有个属性可以避免点击遮罩层导致模态框关闭。就是div中设置的 data-backdrop="static"。这样可以避免在模态框中输入内容时突然的误操作导致模态框关闭。
另外还有一个属性:data-keyboard="false"。此举是设置按下ESC退出键无效。同样是为了避免突然的误操作导致模态框关闭。

<div 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> </div>
其中按钮属性 data-toggle="modal" data-target="#userModal" 是打开模态框。
bootstrap中模态框、模态框的属性的更多相关文章
- bootstrap中的modal 模态弹出框不能放在 form_for里面,一弹出modal会自动submit掉form
bootstrap中的modal 模态弹出框不能放在 form_for里面,一弹出modal会自动submit掉form
- bootstrap中的data-toggle模态框相关
一,点击即打开1,点击按钮 <a href="javascript:void(0)" class="btn btn-primary" data-toggl ...
- bootstrap中selectpicker下拉框使用方法实例
最近一直在用bootstrap 的一些东西,写几篇博客记录下.... bootstrap selectpicker是bootstrap里比较简单的一个下拉框的组件,先看效果如下: 附上官网api链接, ...
- Bootstrap中关闭第二个模态框时出现的问题和解决办法
Bootstrap中关闭第二个模态框时出现的问题和解决办法 1.关闭第二个模态框时,第一个模态框跟着消失. 解决办法: 第二个模态框的代码不要写在第一个模态框里面,确保两个模态框相对独立; 2.关闭第 ...
- Bootstrap中模态框多层嵌套时滚动条问题
在使用Bootstrap中模态框过程中,如果出现多层嵌套的时候,如打开模态框A,然后在A中打开模态框B,在关闭B之后,如果A的内容比较多,滚动条会消失,而变为Body的滚动条,这是由于模态框自带的遮罩 ...
- 黄聪:bootstrap中模态框modal在苹果手机上会失效
bootstrap中模态框在苹果手机上会失效 可将代码修改为<a data-toggle="modal" data-target="#wrap" hre ...
- bootstrap中模态框如果放入form表单中会存在的问题
bootstrap中模态框如果放入form表单中会存在的问题:当模态框显示时,点回车会出现表单自动提交!!!所以在使用模态框的时候要特别注意!
- 使用bootstrap的插件实现模态框效果
在上一篇文章中,我们使用 js+css 实现了模态框效果,在理解了模态框的基本实现方法和实现效果后,我们就要寻找更快捷的方法,又快又好的来完成模态框开发需求,从而节约时间,提高效率.一个好的轮子,不仅 ...
- Bootstrap模态弹出框
前面的话 在 Bootstrap 框架中把模态弹出框统一称为 Modal.这种弹出框效果在大多数 Web 网站的交互中都可见.比如点击一个按钮弹出一个框,弹出的框可能是一段文件描述,也可能带有按钮操作 ...
- BootStrap学习(6)_模态框
一.模态框 模态框(Modal)是覆盖在父窗体上的子窗体.通常,目的是显示来自一个单独的源的内容,可以在不离开父窗体的情况下有一些互动.子窗体可提供信息.交互等. 如果只使用该功能,只引入BootSt ...
随机推荐
- 【ACM】Knapsack without repetition - 01背包问题
无界背包中的状态及状态方程已经不适用于01背包问题,那么我们来比较这两个问题的不同之处,无界背包问题中同一物品可以使用多次,而01背包问题中一个背包仅可使用一次,区别就在这里.我们将 K(ω)改为 K ...
- 二分搜索 - Binary Search
二分搜索是一种在有序数组中寻找目标值的经典方法,也就是说使用前提是『有序数组』.非常简单的题中『有序』特征非常明显,但更多时候可能需要我们自己去构造『有序数组』.下面我们从最基本的二分搜索开始逐步深入 ...
- component: resolve => require(['../pages/home.vue'], resolve)
component: resolve => require(['../pages/home.vue'], resolve) vue 路由的懒加载 import Vue from 'vue' im ...
- SpringBoot中使用Servlet
1.在入口Application类上加入注解@ServletComponentScan @SpringBootApplication @ServletComponentScan public clas ...
- vue interceptors 设置请求头
在main.js添加过滤器,可以 Vue.http.interceptors.push((request,next)=>{ //request.credentials = true; // 接口 ...
- python 列表学习
一.创建一个列表(list)_使用逗号分隔不同的数据项,使用方括号括起来. list = [1,2,3,4,5,6,7] 与字符串的索引一样,列表索引从 0 开始,列表可以截取.组合. 二.访问列表中 ...
- Mybatis学习笔记16 - bind标签
1.${}拼串进行模糊查询,不安全 示例代码: 接口定义: package com.mybatis.dao; import com.mybatis.bean.Employee; import java ...
- VBS 学习
VBS其他功能 获取系统用户名 DimWshNetwork Set WshNetwork =CreateObject("WScript.Network") strTaccount ...
- bootstrap3-dialog:更强大、更灵活的模态框(封装好的模态框)
用过bootstrap框架的同学们都知道,bootstrap自带的模态框用起来很不灵活,可谓鸡肋的很.但nakupanda开源作者封装了一个更强大.更灵活的模态框——bootstrap3-dialog ...
- 初识contiki(2.7版本)
一个偶然的机会,我接触到了contiki这个家伙. Contiki 是一个开源的.高度可移植的.采用 C 语言开发的非常小型的嵌入式操作系统,针对小内存微控制器设计,适用于联网嵌入式系统和无线传感器网 ...