admin管理员组文章数量:1287790
I have searched the web and I have failed to find a solution to adding a scroll to a bootbox custom dialog. Is there anyway I could get it to work. I need a vertical scroll.
Is this possible?
I have searched the web and I have failed to find a solution to adding a scroll to a bootbox custom dialog. Is there anyway I could get it to work. I need a vertical scroll.
Is this possible?
Share Improve this question edited Mar 13, 2016 at 19:12 Abbas Amiri 3,2141 gold badge25 silver badges24 bronze badges asked Mar 13, 2016 at 17:35 KyadKyad 1293 silver badges13 bronze badges 1- please add some sample code to your question, illustrating where you are stuck – Noam Hacker Commented Mar 13, 2016 at 18:06
2 Answers
Reset to default 8Bootbox uses a css class named modal-body
for the body of its dialog; so you can override the class to make it scroll-able. For instance:
.modal-body {
height: 100px;
overflow-y: scroll;
}
If you want your dialog to expand and add scrollbars based on the size of your content, use this:
.modal-body {
max-height: 500px;
overflow-y: auto;
}
That sets the maximum height, after which the scrollbar is added. So if you have little content, no bar and height adjusts to fix. If you have lots of content, you get a scrollbar and the height doesn't get too crazy high.
本文标签: javascriptHow to add a scroll to bootbox dialogStack Overflow
版权声明:本文标题:javascript - How to add a scroll to bootbox dialog? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741321619a2372236.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论