JQuery Slider
How do I make an jquery slider?
A slider. Just for fun.... What is a jquery slider? How do you make a jquery slider? This script and codes were developed by Matt Edwards on 12 August 2022, Friday.
JQuery Slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery Slider</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="row" id="slider"> <div class="main-area"> <div id="featured-item"> <figure> <img src="http://lorempixel.com/600/400/nightlife/1/" alt="" /> <figcaption> <p>Slide 1</p> </figcaption> </figure> </div> </div> <div class="side-area"> <ul class="slider"> <li> <figure> <img src="http://lorempixel.com/600/400/nightlife/2/" alt="" /> <figcaption> <p>Slide 2</p> </figcaption> </figure> </li> <li> <figure> <img src="http://lorempixel.com/600/400/nightlife/3/" alt="" /> <figcaption> <p>Slide 3</p> </figcaption> </figure> </li> <li> <figure> <img src="http://lorempixel.com/600/400/nightlife/8/" alt="" /> <figcaption> <p>Slide 4</p> </figcaption> </figure> </li> <li> <figure> <img src="http://lorempixel.com/600/400/nightlife/5/" alt="" /> <figcaption> <p>Slide 5</p> </figcaption> </figure> </li> <li> <figure> <img src="http://lorempixel.com/600/400/nightlife/6/" alt="" /> <figcaption> <p>Slide 6</p> </figcaption> </figure> </li> </ul> </div>
</div>
<div id="controls"> <button id="prev">Previous</button> <button id="next">Next</button>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
JQuery Slider - Script Codes CSS Codes
img { max-width: 100%;
}
.row { background: #222; max-width: 710px; height: 0; overflow: hidden; padding-bottom: 355px; *zoom: 1;
}
.row:before, .row:after { content: " "; /* 1 */ display: table; /* 2 */
}
.row:after { clear: both;
}
.row .main-area { width: 75%; float: left; margin-right: 1%;
}
.row .side-area { width: 24%; float: left;
}
ul { list-style: none; margin: 0; padding: 0;
}
figure { position: relative; margin: 0; max-width: 100%;
}
figure img { max-width: 100%; height: auto; margin: 0; padding: 0;
}
figure figcaption { position: absolute; bottom: 3px; left: 0; right: 0; background: rgba(0, 0, 0, 0.5);
}
figure figcaption p { text-align: right; margin: 0; padding: 20px; color: white;
}
JQuery Slider - Script Codes JS Codes
jQuery(document).ready(function ($) { var timer; function startTimer() { timer = setInterval(function () { next() }, 4000); } $('#slider').hover(function (ev) { clearInterval(timer); }, function (ev) { startTimer(); }); startTimer(); $('#prev').on('click', function(){ clearInterval(timer); previous(); }); $('#next').on('click', function(){ clearInterval(timer); next(); }); function next() { var feature = $('ul.slider li:first-child'); $(feature).slideUp(2000, function(){ $("#featured-item").fadeOut('fast').html(feature.html()).stop(true,true).hide().fadeIn(); $(this).remove(); }); var newLi = '<li>'+feature.html()+'</li>'; $(newLi).appendTo('ul.slider'); }; function previous() { var oldFeature = $('#featured-item'); var newLi = '<li>'+oldFeature.html()+'</li>'; var feature = $('ul.slider li:last-child'); $(newLi).prependTo('ul.slider'); $(feature).remove(); setTimeout( $("#featured-item").empty().html(feature.html()).stop(true,true).hide().fadeIn(50) , 20); };
});
Developer | Matt Edwards |
Username | mtedwards |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 3,002 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Calendar | 3,834 Kb |
AussieTheatre Logo | 1,756 Kb |
A Quiz, reveal answers and keep score | 3,189 Kb |
JQuery lesson from Treehouse | 3,137 Kb |
JQuery YouTube Playlist | 2,120 Kb |
Responsive layout with Fixed width Sidebar | 2,249 Kb |
Css Skew background for triangular overlay | 2,636 Kb |
JQuery featured gallery | 7,630 Kb |
Let it Rain | 2,746 Kb |
JQuery Star flashing effect | 2,487 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
SVG Hover Animations | Kjbrum | 10,557 Kb |
Angular Route | Arun_v606 | 1,837 Kb |
Clock with full screen background | Owebboy | 2,415 Kb |
A Pen by boilzzz | Boilzzz | 2,761 Kb |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
Rain Landing in a Pond | Edball | 3,009 Kb |
Alumni ECA | MatheusLima92 | 3,777 Kb |
Blank Starter | Mhartington | 2,171 Kb |
Simple Carousel Pure CSS | Dangvanthanh | 4,080 Kb |
Spiralator 9000 | AdmiralPotato | 4,671 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!