0

我想在带有滚动条的小 div 中显示一些“ul”结果,而不是用户需要滚动整个页面,现在我已经通过 css 使其工作:-webkit-overflow-scrolling: touch; ,通常它可以工作,但是当我改变 ipad 的视图时它就坏了。

例如:

<div id="leftpanel">ul ul ul ul</div>
#leftPanel{
       overflow-y: scroll;
       overflow-x: visible;
   -webkit-overflow-scrolling: touch;
       height:100%;
}

在横向视图中div的高度不足以显示所有'ui'然后滚动条起作用,此时将视图更改为纵向视图,div的高度足以显示所有'ul'以便滚动条是禁用自动,最后将视图改回横向滚动条丢失,不可滚动 有解决方案吗?

4

1 回答 1

0

希望这可以帮助 :)

$(window).resize(function() {

    if($('#thumbwrapper').is(":visible")==true)
    {
       //thumbholder is inner div and thumbwrapper outer 
        $('#thumbholder').height(900); 
        window.setTimeout(delayFix, 10);
    }

});

function delayFix()
{
    if($('#thumbwrapper').is(":visible")==true)
    {
        $('#thumbholder').height($("#thumbwrapper").height() + 20);
    }
}
于 2012-07-03T09:30:02.243 回答