Observable
Micro-library for easily implementing lazy-loading, infinite-scrolling and scroll effects into your site.
Under development.
Demos
Install
npm
npm install mobius1-observable --save
const observer = items: items // the elements to observe threshold: 100 // 0 - 100 rootMargin: 0 lazyLoad: false // enable / disable lazy-loading images lazyLoadThreshold: 05 // visibility ratio before image is loaded { // visibility change } infiniteScroll: url: "/path/to/data" // ajax url to fetch pages params: // extra params to be added to request pageParam: "_page" // page number param to add to the request limitParam: "_limit" // limit param to add to the request limit: 10 // limit number of items to fetch next: false // define an element to fetch the next page. If false, the request is automatic {} // fires before request {} // fires when request is complete { // callback when item is fully visible };