gpt4 book ai didi

javascript - Bootstrap Modal 隐藏滚动条

转载 作者:行者123 更新时间:2023-11-28 07:25:23 25 4
gpt4 key购买 nike

我正在使用 Bootstrap v3.3.5。每次触发模式框时,滚动条都会隐藏,从而使网页抖动。能否请您建议我修复。

网址:http://goo.gl/kwn7YH模态由右侧的查询按钮触发。我尝试添加 cutsom JS 来删除边距/填充但没有用:

$(document).on( 'hidden.bs.modal', '.modal', function() {
$(document.body).removeClass( 'modal-scrollbar' );
}).on( 'show.bs.modal', '.modal', function() {
// Bootstrap's .modal-open class hides any scrollbar on the body,
// so if there IS a scrollbar on the body at modal open time, then
// add a right margin to take its place.
if ( $(window).height() < $(document).height() ) {
$(document.body).addClass( 'modal-scrollbar' );
}
});
})(window.jQuery);
});

最佳答案

尝试并使用$('#myModal').hasClass('in');然后在按钮处于事件状态时在按钮右侧应用 17px 填充。

关于javascript - Bootstrap Modal 隐藏滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31857497/

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