项目作者: eugabrielsilva

项目描述 :
Lazy loading directive for AngularJS
高级语言: JavaScript
项目地址: git://github.com/eugabrielsilva/ng-infinite-scroll.git
创建时间: 2021-07-16T21:19:38Z
项目社区:https://github.com/eugabrielsilva/ng-infinite-scroll

开源协议:MIT License

下载


ng-infinite-scroll

ng-infinite-scroll is a very simple and lightweight AngularJS directive that allows you to create lazy loading elements with infinite scrolling effect.

Demo

https://codepen.io/eugabrielsilva/pen/xxyByJr

Usage

Include the directive in your HTML code:

  1. <script src="ng-infinite-scroll.js"></script>

Inject the directive in your application module:

  1. var app = angular.module('app', ['ngInfiniteScroll']);

Put the ng-infinite-scroll attribute in the scroll container, this means, the element where you want the infinite scroll effect.

The attribute value is the AngularJS function or expression you want to eval when the scrolling reaches the bottom of the container.

  1. <div class="scroll" ng-infinite-scroll="lazyLoad()">
  2. ...
  3. </div>