I am using infinite scroll from http://binarymuse.github.io/ngInfiniteScroll v1.1.0. I have a table whose contents will be loaded dynamically as the user scrolls down.

我在http://binarymuse.github.io/ngInfiniteScroll v1.1.0中使用无限滚动。我有一个表,其内容将在用户向下滚动时动态加载。

I did the same thing in this plunk which pushes data inside the array which is displayed inside a div and it works fine as expected.

我在这个plunk中做了同样的事情,它将数据推送到div中显示的数组内,并且按预期工作正常。

When I tried to do the same on other page, showMore() function is called not only on scrolling down but also when scrolling up. Here the structure of the table.

当我尝试在其他页面上执行相同操作时,showMore()函数不仅在向下滚动时被调用,而且在向上滚动时也被调用。这里是表的结构。

<table>
    <thead>
        <tr>
            <th>Some heading</th>       
            <th>Some other heading</th>
        </tr>
    </thead>
    <tbody>
      <div infinite-scroll="showMore()" infinite-scroll-distance="3" infinite-scroll-disabled='infiniteScrollDisabled'>
        <tr ng-repeat="r in report">
            <td>{{$index}}</td>    
            <td">{{r.someData}}</td>
        </tr>
      </div>
    </tbody>
</table>

I dont understand why showMore() function is called even on scrolling up. Has it anything to do with the table structure ?

我不明白为什么showMore()函数甚至在向上滚动时被调用。它与表结构有什么关系吗?

2 个解决方案

#1


2

The solution is to move <div infinite-scroll="showMore()" infinite-scroll-distance="3" infinite-scroll-disabled='infiniteScrollDisabled'>

解决方案是移动

更多相关文章

  1. jQuery:执行一个函数AFTER toggleClass被执行
  2. 等待执行所有ajax回调的最佳解决方案
  3. 使用Sinon模拟require()函数
  4. 如何使函数等到对象的值未定义为js setTimeout
  5. 放在和中的javascript语句,但是语句不在函数中,这些语句何在被执行
  6. [JavaScript]自执行函数
  7. 父范围中的变量不会在匿名函数中被更改[重复]
  8. 如何调用另一个函数内的函数?
  9. res.jwt不是函数 - NodeJS Express

随机推荐

  1. Android Studio Mac下载安装使用教程
  2. android中监听来电并生成悬浮窗口提示
  3. Android百度地图(三):百度地图画运动轨迹
  4. android WebView详解
  5. 使用百度地图SDK 这是之前版本 现在的sdk
  6. 基于 Android NDK 的学习之旅----- C调用
  7. Android的ActivityNotFoundException异常
  8. Android 多线程之 AsyncTask
  9. Android(安卓)-- Vibrator
  10. android 是什么