Created
December 2, 2011 10:57
-
-
Save bastianallgeier/1422798 to your computer and use it in GitHub Desktop.
I'd love to have a :loaded pseudo selector in css, which makes it possible to style elements when they are actually loaded – like images, iframes or the entire document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img { | |
opacity: 0; | |
-webkit-transition: opacity .2s; | |
-moz-transition: opacity .2s; | |
-o-transition: opacity .2s; | |
transition: opacity .2s; | |
} | |
img:loaded { | |
opacity: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would love that to be possible as well. I have a carousel for whose elements I set a background so that something is visible while images, videos and iframes haven't loaded yet. I would like to remove that background after each element has loaded.
@lthoerner does the animation only trigger once the element has loaded?