antimoderate
antimoderate copied to clipboard
Support background-image
+1
+1
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?
@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.
:) 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
Ahah well thanks for trying :water_buffalo:
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.
+1