Skip to content

Instantly share code, notes, and snippets.

@neton-bricio
Forked from anonymous/slider.html
Created April 9, 2016 05:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neton-bricio/a55752d2b3ddcf7eca66e2dde9021933 to your computer and use it in GitHub Desktop.
Save neton-bricio/a55752d2b3ddcf7eca66e2dde9021933 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='UTF-8'>
<title>Simple jQuery Slideshow</title>
<style>
#slideshow {
margin: 80px auto;
position: relative;
width: 160px;
height: 600px;
padding: 10px;
box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
#slideshow > div {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
$(function() {
$("#slideshow > div:gt(0)").hide();
setInterval(function() {
$('#slideshow > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#slideshow');
}, 3000);
});
</script>
</head>
<body>
<div id="slideshow">
<div>
<img src="http://nblabs.tk/cerrado/ADS/img/0.jpg">
</div>
<div>
<img src="http://nblabs.tk/cerrado/ADS/img/1.jpg">
</div>
<div>
<img src="http://nblabs.tk/cerrado/ADS/img/2.jpg">
</div>
<div>
<img src="http://nblabs.tk/cerrado/ADS/img/3.jpg">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment