Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在移动浏览器(Android、Safari、Chrome、Firefox)中滚动div块而不是窗口滚动_Css_Scroll_Height_Overflow_Infinite Scroll - Fatal编程技术网

Css 在移动浏览器(Android、Safari、Chrome、Firefox)中滚动div块而不是窗口滚动

Css 在移动浏览器(Android、Safari、Chrome、Firefox)中滚动div块而不是窗口滚动,css,scroll,height,overflow,infinite-scroll,Css,Scroll,Height,Overflow,Infinite Scroll,我必须滚动div块而不是窗口滚动,我希望这个块将一直到页面结束,如果它更长,那么滚动-它必须出现 我有这样的html: <body> <div id='header'> </div> <div id='content'> <div id='main'> <div id='options'> </div>

我必须滚动div块而不是窗口滚动,我希望这个块将一直到页面结束,如果它更长,那么滚动-它必须出现

我有这样的html:

<body>
    <div id='header'>
    </div>
    <div id='content'>
        <div id='main'>
            <div id='options'>
            </div>
            <!-- other blocks -->
            <div id='scrorable'> <!-- This div i want to scroll instead of window -->
                <table>
                </table>
            </div>
        </div>
    </div>
</body>
我还需要根据滚动div not窗口更改此代码

更新:无限卷轴我以这种方式出售:

在我的滚动div中插入一个内部div:

<div id='scrorable'>
    <div id='scrorable-inner'> <!--My inner div-->
        <-- content -->
        <table>
        </table>
    </div>                    
</div>
更新:

现在我用

  $('div#scrorable').height($(window).height()-300); 
设置那个街区的高度。我使用$window.height-页眉和页脚的高度300px

$('div#scrorable').scroll(function()
{
        if($('div#scrorable').scrollTop() >= $('div#scrorable-inner').height() - $'div#scrorable').height() - 200)
        {
            //ajax Call and append income data to html 
        }
});
  $('div#scrorable').height($(window).height()-300);