angularjs无限滚动的容器 [英] angularjs infinite scroll in a container

查看:575
本文介绍了angularjs无限滚动的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 angularjs无限滚动
似乎仅在滚动是相对于浏览器窗口的工作

I'm trying to use angularjs infinite scroll It seems to work only if the scroll is relative to the browser window.

我愿做无限滚动在内部DIV,即我有一个通用的包装和显示实际内容的内部DIV的页面。

I would like to do infinite scroll in an inner DIV, i.e. I have a page with a generic wrapper and an inner div for displaying the actual content.

该包装页面设置为经过整个窗口,因此它是永远不会滚动。
但包含内容在内的div,有它自己的滚动条。

The wrapper page is set to elapse the entire window, thus it is never scrollable. but the inner div that contain content, has its own scroll bar.

如何我得到的无限滚动相对于内部内容的div滚动条工作?

How to I get the infinite scroll to work relative to the inner content div scrollbar?

推荐答案

在任何情况下,搜索相同的,在这里 - 这里是有用的链接:

In case anyone searches the same and comes here - here are usefull links:

<一个href=\"https://github.com/BinaryMuse/ngInfiniteScroll/pull/7\">https://github.com/BinaryMuse/ngInfiniteScroll/pull/7 (拉请求和讨论)

<一个href=\"https://github.com/hlsolutions/ngInfiniteScroll/tree/scroll-on-any-lement\">https://github.com/hlsolutions/ngInfiniteScroll/tree/scroll-on-any-lement (叉neccessary功能)

https://github.com/hlsolutions/ngInfiniteScroll/tree/scroll-on-any-lement (fork with neccessary functionality)

<一个href=\"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):

You can use it this way (example is in haml):

.div-with-overflow
  %ul{data: {'infinite-scroll' => "getItems()", 'infinite-scroll-disabled' => 'cannotGetItems()', 'infinite-scroll-parent' => 'true'}}

提供了一个'无限滚动父'=&GT; 真正的将要用于计算的,而不是一个窗口的父元素

Providing an 'infinite-scroll-parent' => 'true' will make parent element to be used for calculations instead of a window.

这篇关于angularjs无限滚动的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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