小编Map*_*apa的帖子

将滚动条添加到引导模态主体

我正在尝试将滚动条添加到引导模式主体。但它添加到整个内容。如何将它添加到仅 body.was 使用具有长内容的模态,当达到给定的最大高度时,模态会自动滚动。

这是我的代码

<head>
<!-- Bootstrap CSS-->
<link href="/<s:text name="app.name"/>/css/bootstrap.min.css" rel="stylesheet" type="text/css">

.modal-body {
max-height: calc(100vh - 212px);
overflow-y: auto;
}
</head>


<body>
<div>
<s:if test="user.level == 0 && name != ''">
<button id="roleBtn" class="btn btn-info" type="button" onclick=""
data-toggle="modal" data-target="#roleModal">
<s:text name="roles"/>
</button>
</s:if>
</div>

<div class="modal" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="overflow-y: scroll; max-height:80%;  margin-top: 60px; margin-bottom:30px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel"><s:text name="headingRoles"/></h4>
</div>

<s:form theme="simple" method="post" …
Run Code Online (Sandbox Code Playgroud)

twitter-bootstrap-3

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

twitter-bootstrap-3 ×1