我正在尝试使用AngularJS无限滚动 http://binarymuse.github.io/ngInfiniteScroll/它似乎仅在滚动相对于浏览器窗口时才起作用。
我想在内部 DIV 中进行无限滚动,即我有一个带有通用包装器的页面和一个用于显示实际内容的内部 div。
包装页面设置为覆盖整个窗口,因此它永远不可滚动。
但包含内容的内部 div 有自己的滚动条。
如何让无限滚动相对于内部内容 div 滚动条起作用?
如果有人搜索了相同的内容并来到这里 - 这里有有用的链接:
https://github.com/BinaryMuse/ngInfiniteScroll/pull/7 https://github.com/BinaryMuse/ngInfiniteScroll/pull/7(拉请求和讨论)
https://github.com/hlsolutions/ngInfiniteScroll/tree/scroll-on-any-lement https://github.com/hlsolutions/ngInfiniteScroll/tree/scroll-on-any-lement(具有必要功能的分叉)
https://raw.github.com/hlsolutions/ngInfiniteScroll/scroll-on-any-lement/src/infinite-scroll.coffee https://raw.github.com/hlsolutions/ngInfiniteScroll/scroll-on-any-lement/src/infinite-scroll.coffee(来源本身)
你可以这样使用它(例子在 haml 中):
.div-with-overflow
%ul{data: {'infinite-scroll' => "getItems()", 'infinite-scroll-disabled' => 'cannotGetItems()', 'infinite-scroll-parent' => 'true'}}
提供一个'infinite-scroll-parent' => 'true'
将使父元素而不是窗口用于计算。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)