引导模态块选择元素
Bootstrap Modal blocks select element
当模态出现时,有一个选择列表锚定在页面的左上角。最终,该列表将用于提供导航选项;但是我无法在列表中选择一个选项。 我试图将 z 指数设置为高于模态,但似乎没有任何效果。 希望有人能阐明解决方案?谢谢!
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tool</title>
<!-- Bootstrap v2.3.2 -->
<link href="css/bootstrap.css" rel="stylesheet" />
</head>
<body>
<button type="button" class="onl btn btn-success btn_online">Submit</button>
<!-- popup message -->
<div id="popup_message" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="_c1g">Description</h3>
</div>
<div class="well msg" id="msg" style="max-height:400px;overflow:auto;"></div>
<div class="modal-footer">
<button class="btn _c1e" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
<script src="script/jquery-1.8.3.js" type="text/javascript"></script>
<!--Bootstrap v3.0.0-->
<script src="script/bootstrap.min.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
$(document).on('click', '.btn_online', function (e) {
$('#popup_message').modal('show');
$("body").append("<select id='my_redirect' style='top:20px;left:20px;z-index:1051;position:absolute;'><option value='' >Select...</option><option value='Page1' >Page1</option><option value='Page2' >Page2</option></select>")
});
});
</script>
要解决模态在关闭时阻塞其下所有元素的问题,您还可以添加以下块:
<style>
/*Modal blocking caused issues with selecting objects*/
.modal { display:none; }
</style>
Twitter 引导多模态错误
我的假设是正确的。 模态强制关注自身。以上有@SmartLove创建的解决方案。 基本上将以下内容放在引导脚本之后。
$.fn.modal.Constructor.prototype.enforceFocus = function () {};
现在选择元素按预期工作!呜呼!
相关文章:
- WebdriverIO waitForExist()选择元素's选定的选项
- 如何选择元素的第n个子元素
- Angular没有根据模型更新我的选择元素
- jquery使用name from变量按类选择元素
- 如何使用jQuery按数据日期属性选择元素
- 向html选择元素添加选项
- 使用Jquery在相同类型的元素中选择元素
- 他们是如何使用angular/jqLite find()方法按属性名称和值选择元素的?ng conf 2015
- 如何在Angular中清除选择元素中的过滤器
- 使用其中一个元素作为参考点,从Javascript数组中选择元素
- Javascript选择元素到字符串的比较
- Angular始终选择选择元素中的第一个选项
- 使用 jquery .find() 遍历按类和存储属性选择元素
- 通过 id json, jquery 选择元素
- 如何基于另一个已经存在的选择器选择元素
- 禁用多个选择元素中的非“选定”选项,但使用 jquery 的一个除外
- HTML 选择元素的只读等效项
- 在iPad上,如何通过Javascript事件在选择元素上设置focus()而不显示选项
- 单击事件似乎不适用于 IE 中的选择元素
- Angular js,在选择元素上,我想 POST 数据以将其保存在数据库中,然后我想使用 PUT 更新它而无需重新加载