lorenzofox3 / lrinfinitescroll Goto Github PK
View Code? Open in Web Editor NEWdirective to register handler when an element is scrolled down near its end http://lorenzofox3.github.io/lrInfiniteScroll/index.html
directive to register handler when an element is scrolled down near its end http://lorenzofox3.github.io/lrInfiniteScroll/index.html
We use NPM for managing front end code, would be nice to be able to install this directly :)
Would be great if this was made into a bower package, and also if the documentation was added to.
There doesn't seem to be a working example with code (plunker), other than what is on the examples page (http://lorenzofox3.github.io/lrInfiniteScroll/index.html#example)
I have been unable to make this module work, and I think this is due to lack of a working example with code. My case, for example, uses Smart Table. I would like to see a working example and how it can be used in conjunction with Smart Table.
I needed for my app to support full page scrolling so I've modified your directive to support "target" attribute. (Sorry I don't have time to do a PR). The following code supports both scrolling an element other than the current one (if you use routes and need to target a parent) and the special case of the whole page scrolling - 'window'.
Full code is in this gist: https://gist.github.com/SimeonC/a15055a5b9ec0c5685da.
Highlights below:
Inserted at Line 12:
bindTarget = element,
calculateRemaining = function(){
return element[0].scrollHeight - (element[0].clientHeight + element[0].scrollTop);
};
if (attr.target) {
if (attr.target.toLowerCase() === 'window') {
bindTarget = angular.element(window);
element = angular.element(document.querySelector('body'))
calculateRemaining = function(){
return element[0].offsetHeight - (window.pageYOffset + window.innerHeight);
};
}
else element = angular.element(document.querySelector(attr.target));
}
Line 35:
bindTarget.bind(
'scroll', function () {
var remaining = calculateRemaining();
//if we have reached the threshold and we scroll down
Is it possible to start in the middle of a list and scroll both up and down?
Can you please help in how to use this with infinite horizontal scrolling?
Thanks
I have an issue with this setup:
<div lr-infinite-scroll="loadMore">
<my-component type='item.type' ng-repeat='item in items'></my-component>
</div>
I have a directive inside with different html template for each item type. The infinite scrolling works perfectly but when I change the item array with items with different type the template remains the same.
Im using this plugin, works great. but it's also triggering loadMoreRecords function on horizontal scroll just for ONCE.
It could be great to be able to download and install it from bower catalog.
Heyo :)
First, thanks for writing such a nifty module!
Could you create a release 1.0.1
that points to revision bd8fd2b so CommonJS imports of this module are supported when installing via Bower? Currently, Bower installers have to write their own index.js
file after installing.
module looks great- thank you.
Having difficulty getting element.bind('scroll', function () {
working. Module loads and line read; scrolling does not trigger function though. Can't get any element scrolling to trigger bound scroll function. Using:
<div class="search-grid container-fluid" ng-class="{starred: currentSearch.starred}" lr-infinite-scroll="loadMore()" scroll scroll-threshold="200" time-threshold="200" >
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.