工作中有需要用到模态框的可以看看

<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">
&times;
</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中模态框、模态框的属性的更多相关文章

  1. bootstrap中的modal 模态弹出框不能放在 form_for里面,一弹出modal会自动submit掉form

    bootstrap中的modal 模态弹出框不能放在 form_for里面,一弹出modal会自动submit掉form

  2. bootstrap中的data-toggle模态框相关

    一,点击即打开1,点击按钮 <a href="javascript:void(0)" class="btn btn-primary" data-toggl ...

  3. bootstrap中selectpicker下拉框使用方法实例

    最近一直在用bootstrap 的一些东西,写几篇博客记录下.... bootstrap selectpicker是bootstrap里比较简单的一个下拉框的组件,先看效果如下: 附上官网api链接, ...

  4. Bootstrap中关闭第二个模态框时出现的问题和解决办法

    Bootstrap中关闭第二个模态框时出现的问题和解决办法 1.关闭第二个模态框时,第一个模态框跟着消失. 解决办法: 第二个模态框的代码不要写在第一个模态框里面,确保两个模态框相对独立; 2.关闭第 ...

  5. Bootstrap中模态框多层嵌套时滚动条问题

    在使用Bootstrap中模态框过程中,如果出现多层嵌套的时候,如打开模态框A,然后在A中打开模态框B,在关闭B之后,如果A的内容比较多,滚动条会消失,而变为Body的滚动条,这是由于模态框自带的遮罩 ...

  6. 黄聪:bootstrap中模态框modal在苹果手机上会失效

    bootstrap中模态框在苹果手机上会失效 可将代码修改为<a  data-toggle="modal" data-target="#wrap" hre ...

  7. bootstrap中模态框如果放入form表单中会存在的问题

    bootstrap中模态框如果放入form表单中会存在的问题:当模态框显示时,点回车会出现表单自动提交!!!所以在使用模态框的时候要特别注意!

  8. 使用bootstrap的插件实现模态框效果

    在上一篇文章中,我们使用 js+css 实现了模态框效果,在理解了模态框的基本实现方法和实现效果后,我们就要寻找更快捷的方法,又快又好的来完成模态框开发需求,从而节约时间,提高效率.一个好的轮子,不仅 ...

  9. Bootstrap模态弹出框

    前面的话 在 Bootstrap 框架中把模态弹出框统一称为 Modal.这种弹出框效果在大多数 Web 网站的交互中都可见.比如点击一个按钮弹出一个框,弹出的框可能是一段文件描述,也可能带有按钮操作 ...

  10. BootStrap学习(6)_模态框

    一.模态框 模态框(Modal)是覆盖在父窗体上的子窗体.通常,目的是显示来自一个单独的源的内容,可以在不离开父窗体的情况下有一些互动.子窗体可提供信息.交互等. 如果只使用该功能,只引入BootSt ...

随机推荐

  1. 查看SQL SERVER Job details

    SELECT [sJOB].[job_id] AS [JobID] , [sJOB].[name] AS [JobName] , [sDBP].[name] AS [JobOwner] , [sCAT ...

  2. (转)CentOS下的trap命令

    trap命令用于指定在接收到信号后将要采取的动作.常见的用途是在脚本程序被中断时完成清理工作.不过,这次我遇到它,是因为客户有个需求:从终端访问服务器的用户,其登陆服务器后会自动运行某个命令,例如打开 ...

  3. Python 多继承(新式类) 的mro算法

    转载自:http://www.cnblogs.com/panyinghua/p/3283831.html mro即method resolution order,主要用于在多继承时判断调的属性的路径( ...

  4. 搭建Activemq集群

    首先搭建zookeeper集群: 参考URL:  http://www.cnblogs.com/feiyun126/p/7244394.html 三台服务器:先设置hosts 10.0.0.231 n ...

  5. 新建mavent项目报错

    1.找到自己项目 项目名\.settings\org.eclipse.wst.common.project.facet.core.xml 将<installed facet="jst. ...

  6. jQuery 3 有哪些新东西

    jQuery 的横空出世,至今已有十个年头了,而它的长盛不衰显然不是没有理由的.jQuery 提供了极为友好的接口,使得开发者们可以方便地进行 DOM 操作.发起 Ajax 请求.生成动画……不一而足 ...

  7. Oracle同义词、索引、分区

    同义词:是现有对象的一个别名 简化SQL语句 隐藏对象的名称和所有者 提供对对象的公共访问 同义词共有两种类型 私有同义词只能在其模式内访问,且不能与当前模式的对象同名 公有同义词可被所有的数据库用户 ...

  8. collides with another import statement解决办法

    如我要导入的两个包名为: import com.tesla.gateway.core.filter.Filter import ch.qos.logbak.core.filter.Filter 这样就 ...

  9. eclipse svn 环境搭建

    subversion 1.8.14(r1692801) eclipse 安装插件 1.10.x版本

  10. c#和c++的运算符优先级

    闲来无聊乱写代码.发现基础的东西有的时候也非常的抽象.不信?那来看看下面这条语句: ; ; j = i = -i++; 如果上述代码是vc++代码,那么输出结果是: i=- j=- 请按任意键继续. ...