Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Listen to CSS Background Images #1

Open
lukeed opened this issue Jul 31, 2017 · 0 comments
Open

[RFC] Listen to CSS Background Images #1

lukeed opened this issue Jul 31, 2017 · 0 comments
Labels

Comments

@lukeed
Copy link
Owner

lukeed commented Jul 31, 2017

If this lands, it will be a 2.0 release & thus will be the distinguishing feature between v1 and v2.

Most of the time when I'm trying to do a fair bit of animating, it's never on a <img/> directly. It's nearly always on a <div> with a background-image style property.

In those cases, I'd (presumably) like to know when the image has completely downloaded before I begin the non-critical animation. IMO, it's far worse to have something fly/scale in, only to be partially loaded and/or lag the browser while it tries to pain the image and animate at the same time.

Here's how it would look, I think:

// load all <div>s' background-images
onloaded('.slide > div', { background:true });

// load the background-images on .container's .slide nodes
onloaded('.container', { background:'.slide' });

I'm only guessing, but doing so may add roughly ~100-200 bytes, which is a significant increase since 1.0 is only 350 bytes.

Please cast your vote below 😆



@lukeed lukeed added the discuss label Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant