如何使模式滚动与主页 [英] How to make modal scroll with main page

查看:114
本文介绍了如何使模式滚动与主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模态的内容高于浏览器的高度,因此我有一些内容,无法显示。 (似乎模态位置是固定的,不能作为一个整体滚动)





如何使主页面的模态可滚动,以便我可以实际查看下面的内容?

解决方案

你可以做的是将modal的CSS position 设置为absolute 。



要做到这一点,只需获取这样的模态或ID的类名,并将其设置为 absolute

  .modal {
position:absolute!important;
}

或者,更好的是,编辑你的modal的主CSS )并将位置固定更改为 absolute 。 / p>

jsFiddle示例: http://jsfiddle.net/hUNZs/ p>

I have a modal with the contents taller than the browser height, as a result I have some contents which cannot be displayed. (seems like the modal position is fixed and cannot be scrolled as a whole)

How can I make the modal scrollable with the main page so that I can actually view the contents below?

解决方案

What you could do is set the modal's CSS position to absolute instead of fixed.

To do this, just get the class name of the modal or ID like this and set it to absolute:

.modal {
position: absolute !important;
}

Or, even better, edit the main CSS for your modal (if you can) and change the position from fixed to absolute.

jsFiddle example: http://jsfiddle.net/hUNZs/

这篇关于如何使模式滚动与主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆