Some inspiration for loading effects of grid items using CSS animations.
codrops / gridloadingeffects Goto Github PK
View Code? Open in Web Editor NEWSome inspiration for loading effects of grid items using CSS animations.
Some inspiration for loading effects of grid items using CSS animations.
Some inspiration for loading effects of grid items using CSS animations.
How do you hide the images before Masonry organizes them into a grid? My shows the images in a pile as they are being loaded and then finally once they are all loaded then Masonry organizes them nicely.
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library codrops/GridLoadingEffects
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "codrops/GridLoadingEffects",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
Is there a way to have a fallback for IE (7-8)? I don't care about transitions, but is there a possibility to have the grid pattern?
Errors:
SCRIPT5014: Array.prototype.slice: 'this' is not a JavaScript object
AnimOnScroll.js, line 89 character 4
SCRIPT438: Object doesn't support property or method 'addEventListener'
demoad.js, line 13 character 1
how set right to left direction??
Nvm
Hi all, thanks for this amazing demo and for making it open source!
I'm using the code on my website and I notice that the _onScrollFn
was being executed even after all the "items" were already animated...
Looking at the code, I notice something wrong on this line
As you can see, the code isn't removing the listener...
this is because the function passed on addEventListener
is an anonymous function,
see here
if you want to remove this listener, you have to pass the right reference of the function that was passed on addEventListener
.
There are some ways to resolve this.
You just have to store the function's reference that was passed on addEventListener
and then pass this reference on this line
I fixed it like this:
First I've declared the _onScrollFn
like this, outside the scope of AnimOnScroll
class
function onScrollHandler() {
var self = this;
if( !this.didScroll ) {
this.didScroll = true;
setTimeout( function() { self._scrollPage(); }, 60 );
}
}
Then, on the constructor function, I'm creating a bound function and adding it to the instance, so when called, has its this
keyword set to the provided value ( the object instance )
this._onScrollFn = onScrollHandler.bind( this );
So, when calling both addEventListener
and removeEventListener
, we pass this._onScrollFn
.
window.addEventListener( 'scroll', self._onScrollFn, false );
_checkTotalRendered : function() {
++this.itemsRenderedCount;
if( this.itemsRenderedCount === this.itemsCount ) {
window.removeEventListener( 'scroll', this._onScrollFn );
}
}
The Function.prototype.bind()
isn't supported on versions < IE9
,
there is a polyfill, though.
I can create a PR with this fix
if you guys think it's ok...
Thank you again
Hi codrops,
I'm implementing this on a new website and I'm trying to add a filter system to the masonry, but I'm not able to run any of the masonry options, since it's being recreated on AnimeOnScroll.
Any idea on how I can reload the grid, after hiding the filtered cards?
What I was trying to do, but is currently failing:
$li.removeClass('active'); $('#grid').find('.item-'+targetLink).addClass('hidden'); $('#grid').masonry('layout');
Thank you :)
is it possible to use a manual "load more" button instead of default infinite scrolling ?
Thanks !
Greetings!
Thank You much for Your work!
Can I use it in vanilla css/js? (not an issue but question, please close if needed)
Best regards, Gennady
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.