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

<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数据库 三种 恢复模式

    SQL SERVER 2005 以后三种恢复模式: 简单(Sample),完全(Full),大批量(Bulk_Logged) 完全备份模型 完全备份模式是指在出现数据文件毁坏时丢失数据的风险最小.如果 ...

  2. VS 快速插入无参构造器

    输入ctor后 点击两次Tab键,即可快速插入无参构造器.

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

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

  4. 换晶振导致stm32串口数据飞码的解决办法

    一般来说,stm32f107都是用标配的晶振,比如8MHz. 但是,如果用别的晶振,比如13.56M的晶振,那串口接收还正常吗? 根据试验结果,很可能会飞码.比如说用串口助手发送的是0x35,但是在串 ...

  5. Ubuntu瞎胡搞

    ubutnu的几个必不可少的软件: 1.Guake,超级方便的终端 2.Unity tweak tool 3.VLC,本地视频播放器 4.MyPint,简单画图软件 5.GIMP,PS工具 Subli ...

  6. [CF 612E]Square Root of Permutation

    A permutation of length n is an array containing each integer from 1 to n exactly once. For example, ...

  7. NOPI导出execl 多个sheet,一列图片

    NPOI API: http://www.cnblogs.com/atao/archive/2009/11/15/1603528.html http://blog.csdn.net/pan_junbi ...

  8. Debug Diagnostics Tool创建.Net异常转储并用Windbg分析异常

    当我们要在IIS PRD环境下分析异常,并且对问题毫无头绪,又没有权限直接上打Log的代码.这个时候就是Debug Diagnostics Tool & Windbg大显神威的时候了. Deb ...

  9. Eclipse jee 3.7常用插件安装手记

    最近在折腾Maven,于是想重新配置一个Eclipse环境,插件安装挺折腾人的,尤其天朝的网络,你懂的,伤不起啊,因此特地把正确的过程记录下来,供大家参考,节省时间 1.官网下载eclipse-jee ...

  10. mysql存储过程中最后有commit和没有commit 是有所不同的。(为测试但是碰到过这个问题)

    如果存储过程中没有执行commit,那么spring容器一旦发生了事务回滚,存储过程执行的操作也会回滚.如果存储过程执行了commit,那么数据库自身的事务此时已提交,这时即使在spring容器中托管 ...