gpt4 book ai didi

twitter-bootstrap - 具有 2 个模式的 Bootstrap,屏幕卡住

转载 作者:行者123 更新时间:2023-12-03 00:38:04 24 4
gpt4 key购买 nike

我需要从另一个模态打开一个模态,我的问题是当模态高度很大时。当我关闭第二个模式时,我松开页面上的滚动并且页面被卡住。这是一个说明我的问题的笨蛋: plunkr

<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>

<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#firstsModal">
<span class="glyphicon glyphicon-flash"></span> 1st modal
</button>

<div class="modal fade" id="firstsModal" tabindex="-1" role="dialog"
aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:60%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
>&times;</button>

</div>
<div class="modal-body row" style =" margin-left: -0px; margin-right: 0px;">
<div class=" col-sm-12">

<table class="table table-striped table-bordered">
<thead>

<tr>
<th style="text-align:center">Catégorie</th>


</tr>
</thead>
<tbody>
<tr><td>1</td></tr>
<tr><td>1</td></tr>
...
<tr><td>1</td></tr>
<tr><td>1</td></tr>
<tr><td>1</td></tr>
</tbody>
</table>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#secondmodal">
2nd modal
</button>
</div>
</div>
<div class="modal-footer" style="text-align:center">
<button type="button" class="btn btn-success" data-dismiss="modal" >
<span class="glyphicon glyphicon-ok-circle"></span> Ok
</button>
</div>
</div>
</div>
</div>

<div class="modal fade" id="secondmodal" tabindex="-1" role="dialog"
aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:60%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
>&times;</button>

</div>
<div class="modal-body row" style =" margin-left: -0px; margin-right: 0px;">
<div class=" col-sm-12">

<table class="table table-striped table-bordered">
<thead>

<tr>
<th style="text-align:center">Catégorie</th>


</tr>
</thead>
<tbody>
<tr><td>1</td></tr>
<tr><td>1</td></tr>
....
<tr><td>1</td></tr>
<tr><td>1</td></tr>
<tr><td>1</td></tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer" style="text-align:center">
<button type="button" class="btn btn-success" data-dismiss="modal" >
<span class="glyphicon glyphicon-ok-circle"></span> Ok
</button>
</div>
</div>
</div>
</div>
</body>

</html>

最佳答案

有人提出了同样的问题,并提供了解决方案:

Bootstrap Modal Issue - Scrolling Gets Disabled

根据上述问题的答案,下面的 CSS 代码解决了该问题。

#firstsModal {
overflow-y: scroll;
}

你能看一下这个演示吗:http://plnkr.co/edit/ZiQZniY1sz1xnhnxl20z?p=preview

关于twitter-bootstrap - 具有 2 个模式的 Bootstrap,屏幕卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29073252/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com