【发布时间】:2013-02-06 07:32:25
【问题描述】:
jQuery Mobile popup 维度仅限于具有15px margin on the left an right sides, and a 30px margin on the top and bottom。如果内容对于这些限制而言太大,则弹出窗口会变长(而不是更宽),因此必须滚动整个页面才能查看弹出内容。
我需要改变这种行为,使弹出窗口的尺寸永远不会超过窗口的高度,并且内容可以在弹出窗口中垂直滚动。
因此可以限制弹出窗口的大小:
$('#popup').on({
popupbeforeposition: function() {
var maxHeight = $(window).height() - 30
$('#popup').css('max-height', maxHeight + 'px')
}
})
...但是弹窗内容是一样的,通过弹窗底部仍然强制用户滚动页面,而不是弹窗内的内容。
如何让弹出内容在弹出内容中垂直滚动?
【问题讨论】:
标签: jquery-mobile popup