最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

bootstrap中模态框、模态框的属性

来源:懂视网 责编:小采 时间:2020-11-27 15:35:57
文档

bootstrap中模态框、模态框的属性

bootstrap中模态框、模态框的属性:工作中有需要用到模态框的可以看看<p class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hi
推荐度:
导读bootstrap中模态框、模态框的属性:工作中有需要用到模态框的可以看看<p class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hi
工作中有需要用到模态框的可以看看

<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中文网!

文档

bootstrap中模态框、模态框的属性

bootstrap中模态框、模态框的属性:工作中有需要用到模态框的可以看看<p class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hi
推荐度:
标签: 属性 Bootstrap modal
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top