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

Support background-image #2

Open
whackashoe opened this issue Nov 7, 2015 · 7 comments
Open

Support background-image #2

whackashoe opened this issue Nov 7, 2015 · 7 comments

Comments

@whackashoe
Copy link
Owner

No description provided.

@bka-frontend
Copy link

+1

1 similar comment
@kozleek
Copy link

kozleek commented Dec 11, 2015

+1

@huwd
Copy link

huwd commented Dec 12, 2015

That's exactly what I'm looking for too, but how - this works by crawling the DOM and replacing the contents of an tag + the animation, right?

Can js crawl a separate CSS document and do the same?

@whackashoe
Copy link
Owner Author

@huwd yeah right now it replaces the src attribute, a similar thing would need to be done but for background image. the code would just set el.style.backgroundImage to what it would have set to src.

@huwd
Copy link

huwd commented Dec 13, 2015

:) Thought I'd try and do a pull request but after some fiddling on codepen I realise I'm outta my depth.js

Is there any chance the solution you describe above could also work at passing in alternative sass variables? Using bourbon neat currently got my $tiny-res and $full-res setup, just need the javascript to swap em and trigger your animation

@whackashoe
Copy link
Owner Author

Ahah well thanks for trying 🐃

It definitely should if the js was implemented for bg image. I guess instead of using a data attribute then, it !might! make sense to pop the tiny-res into their own css classes and have the js read the tiny-res from them. That would also have the added benefit that you could cache that file for the images which would be pretty neat.

@DannyFeliz
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants