【发布时间】:2018-05-24 02:23:00
【问题描述】:
每当我从 Materializecss 打开一个模式时,滚动条(我的身体有内联滚动条)每次都会隐藏。我应该怎么做,每当我打开一个模态时,身体的滚动条都会保留?
<body>
<div id="modal_confirm_block" class="modal modal_dialog">
<div class="modal-content white" id="modal_confirm_co_content" style="padding:0px !important;">
<div id="div_available" class="center-align" style="padding: 20px !important;"> <i class="material-icons md-12 noselect center-align amber-text darken-4" > warning</i><br>
<p style="padding:20px !important;" class="center-align"> Are you sure you want to block this guest? </p>
</div>
</div>
<div class="modal-footer">
<div class="row" style="margin: 0 !important;">
<div class="col s6"> <a href="#!" id="btn_confirm_block" class=" cyan darken-2 white-text modal-action waves-effect waves-white btn" style="width:100% !important;">Confirm</a></div>
<div class="col s6"> <a href="#!" id="btn_cancel_block" class="blue-grey darken-4 white-text modal-action modal-close waves-effect waves-white btn" style="width:100% !important; ">Cancel</a></div>
</div>
</div>
</div>
</body>
Screenshot before opening a modal
Screenshot when a modal opens. Look at the scrollbar it was removed. And I don't like that because the screen always move.
【问题讨论】:
-
如果您发布一个有效的 sn-p,也许我们可以提供帮助
-
@MhdAlaaAlhaj 我添加了 2 个屏幕截图。一个在打开模式之前显示滚动条,然后是第二个,当模式打开时滚动条总是消失。
标签: html css materialize