-
-
Save yoanmarchal/4493312 to your computer and use it in GitHub Desktop.
responsive slider css + jquery
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
#slideshow { | |
width: 100%; | |
position: relative; | |
} | |
img { | |
top: 0; | |
left: 0; | |
width: 100%; | |
max-width: 600px; | |
height: auto; | |
position: absolute; | |
} |
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 id="slideshow"> | |
<img src="1.jpg" /> | |
<img src="2.jpg" /> | |
<img src="3.jpg" /> | |
</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
$(function () { | |
// Simplest jQuery slideshow by Jonathan Snook | |
$('#slideshow img:gt(0)').hide(); | |
setInterval(function () { | |
$('#slideshow :first-child').fadeOut(1000) | |
.next('img').fadeIn(1000).end().appendTo('#slideshow'); | |
}, 4000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment