Comments (5)
Nice!
I'll close this then 👍
And document for this for future issues :)
from waterfall.js.
Yeah, it's possible.
But does make sense make this change?
In which cases you think it gonna be useful @lnmunhoz?
What do you think @israelst ?
from waterfall.js.
I'm using in a infinite loading context. I just solved like this:
const cardsBox = this.firstNode;
cardsBox._uihooks = {
insertElement: (node, next) => {
$(node).insertBefore(next);
$(node).imagesLoaded(() => {
// Retrieve the current amount on the grid
this.data.onItemReady($(cardsBox).find('.item').length);
waterfall(cardsBox);
});
}
}
After each rendered item I'm getting the length of the grid and passing to my onItemReady
callback. So when I reach a certain number of elements It will be able to "fetch more" in my list.
This is not actually a problem, I solved very quickly. But with masonry I had a callback that does this trick for me.
It can be useful for dynamic contexts like mine.
from waterfall.js.
Hello @lnmunhoz, why don't you simply use cardsBox.childNodes.length
or cardsBox.childElementCount
?
Did I get something wrong?
The Node.childNodes read-only property returns a live collection of child nodes of the given element.
https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes
from waterfall.js.
Works perfectly!
from waterfall.js.
Related Issues (20)
- Add UMD support HOT 1
- Add and implement a code style. HOT 4
- Layout goes wrong with setting element style of parent. HOT 6
- Provide a link for waterfall to jump to imgStatus
- require by commonJS HOT 2
- Layout issues HOT 4
- Table w/ differences between waterfall, mansory an others HOT 1
- need another argument to config and update the smallestcolumn array length HOT 1
- How about support module style? HOT 7
- ES6 HOT 4
- Readme
- Contributing guidelines
- Preserve Proper Order of Items HOT 2
- Columns are stacked to the left HOT 3
- not `bower install waterfall.js` but `bower install waterfal` HOT 3
- Lazy Loading HOT 1
- TypeError: Cannot read property 'style' of undefined HOT 3
- TypeError: null is not an object (evaluating 'container.children') HOT 1
- Class selectors in the constructor do not create multiple instances of waterfall
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waterfall.js.