-
-
Save oli/1991345 to your computer and use it in GitHub Desktop.
Crossfade images by transitioning background-image
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
/* Crossfade images by transitioning background-image */ | |
/* tweaked from dabblet by Zee Agency mentioned in https://twitter.com/ChromiumDev/status/174568285822664704 */ | |
div { | |
width: 400px; | |
height: 200px; | |
background-image: url("http://lorempixel.com/400/200/animals/1/"); | |
background-repeat: no-repeat; | |
transition: background-image 0.5s; | |
} | |
div:hover { | |
background-image: url("http://lorempixel.com/400/200/animals/2/"); | |
} |
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
<div></div> |
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
{"view":"split","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment