Last active
December 6, 2015 13:28
-
-
Save floriandejonckheere/3b1c0470abaff38cfbd3 to your computer and use it in GitHub Desktop.
Pure CSS3 slideshow
This file contains hidden or 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 class="slideshow"> | |
| <img src="slideshow-001.png" alt="Slideshow 1"> | |
| <img src="slideshow-002.png" alt="Slideshow 2"> | |
| </div> |
This file contains hidden or 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
| .slideshow { | |
| position: relative; | |
| /* adjust to fit images */ | |
| height: 350px; | |
| img { | |
| position: absolute; | |
| opacity: 0; | |
| &:first-child { opacity: 1; } | |
| transition: opacity .5s; | |
| &:nth-child(1) { animation: xfade 8s 0s infinite; } | |
| &:nth-child(2) { animation: xfade 8s 4s infinite; } | |
| /* add if necessary */ | |
| } | |
| } | |
| @keyframes xfade { | |
| 0% { opacity: 0; } | |
| 10% { opacity: 1; } | |
| 50% { opacity: 1; } | |
| 60% { opacity: 0; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment