Simple jQuery Slider
How do I make an simple jquery slider?
What is a simple jquery slider? How do you make a simple jquery slider? This script and codes were developed by John Urbank on 08 July 2022, Friday.
Simple jQuery Slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple jQuery Slider</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=Lato:300,400'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { background: rgb(191, 76, 76);
}
/* slider
----------------------*/
.slide-wrap { margin: 5% auto 0; width: 50%;
}
.slide-mask { position: relative; overflow: hidden; height: 130px;
}
.slide-group { position: absolute; top: 0px; left: 0; width: 100%;
}
.slide { height: 130px; font: 100 90px/135px "lato"; font-size: 2em; color: #fff; text-align: center; text-transform: uppercase;
}
/* nav
----------------------*/
.slide-nav { text-align: center;
}
.slide-nav ul { margin: 0; padding: 0;
}
.slide-nav li { display: inline-block; width: 10px; height: 10px; background: rgb(175, 56, 56); cursor: pointer; margin-left: .5em;
}
.slide-nav li.current { background: rgb(144, 39, 39);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="slide-wrap"> <div class="slide-mask"> <ul class="slide-group"> <li class="slide">this</li> <li class="slide">is</li> <li class="slide">a</li> <li class="slide">simple</li> <li class="slide">slider</li> </ul> </div> <div class="slide-nav"> <ul> <li class="bullet"></li> <li class="bullet"></li> <li class="bullet"></li> <li class="bullet"></li> <li class="bullet"></li> </ul> </div>
</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>
Simple jQuery Slider - Script Codes CSS Codes
body { background: rgb(191, 76, 76);
}
/* slider
----------------------*/
.slide-wrap { margin: 5% auto 0; width: 50%;
}
.slide-mask { position: relative; overflow: hidden; height: 130px;
}
.slide-group { position: absolute; top: 0px; left: 0; width: 100%;
}
.slide { height: 130px; font: 100 90px/135px "lato"; font-size: 2em; color: #fff; text-align: center; text-transform: uppercase;
}
/* nav
----------------------*/
.slide-nav { text-align: center;
}
.slide-nav ul { margin: 0; padding: 0;
}
.slide-nav li { display: inline-block; width: 10px; height: 10px; background: rgb(175, 56, 56); cursor: pointer; margin-left: .5em;
}
.slide-nav li.current { background: rgb(144, 39, 39);
}
Simple jQuery Slider - Script Codes JS Codes
var $slide = $('.slide'), $slideGroup = $('.slide-group'), $bullet = $('.bullet');
var slidesTotal = ($slide.length - 1), current = 0, isAutoSliding = true;
$bullet.first().addClass('current');
var clickSlide = function() { //stop auto sliding window.clearInterval(autoSlide); isAutoSliding = false; var slideIndex = $bullet.index($(this)); updateIndex(slideIndex);
};
var updateIndex = function(currentSlide) { if(isAutoSliding) { if(current === slidesTotal) { current = 0; } else { current++; } } else { current = currentSlide; } $bullet.removeClass('current'); $bullet.eq(current).addClass('current'); transition(current);
};
var transition = function(slidePosition) { $slideGroup.animate({ 'top': '-' + slidePosition + '00%' });
};
$bullet.on( 'click', clickSlide);
var autoSlide = window.setInterval(updateIndex, 2000);
Developer | John Urbank |
Username | jurbank |
Uploaded | July 08, 2022 |
Rating | 4.5 |
Size | 2,874 Kb |
Views | 46,552 |
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 |
Diagonal CSS Pattern | 1,790 Kb |
Canvas Geometry | 2,242 Kb |
Traveling through Tron - Best viewed in Webkit | 3,195 Kb |
Mouse Trailing | 3,268 Kb |
Lego style loading text | 5,209 Kb |
Tape Cassette Icon - CSS Only | 6,789 Kb |
Logo Slider | 3,508 Kb |
A Pen by John Urbank | 2,984 Kb |
Simple, CSS only, responsive menu | 2,615 Kb |
Gutterless Feature Grid | 3,013 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 |
No Vacancy 404 CSS Only | Sethkontny | 0 Kb |
Animated Vertical CSS3 Menu Black | MaCeLMp4 | 2,750 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
Expert Help | SinceSidSlid | 4,064 Kb |
Twinner Spinner II | Katydecorah | 2,974 Kb |
Video Player Custom Controls | EleftheriaBatsou | 3,665 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Two tables and header with jspdf-autotable | Someatoms | 2,245 Kb |
Fluid Responsive Typography | Jonmilner | 4,205 Kb |
Table border-collapse property | Maxds | 1,672 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!