Minimal jQuery Auto-fading Image Carousel Plugin - Fadeimages
File Size: | 2.14 MB |
---|---|
Views Total: | 4220 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
Fadeimages is a minimalist jQuery plugin for creating a responsive image carousel with automatic fade-in and fade-out transitions.
Features:
- Responsive and full width.
- Extremely lightweight. Only 3kb unminified.
- Bottom dots navigation.
- Auto loop when reaches the last slide.
- Auto play and pause on mouse hover.
- jQuery based cross-browser transitions.
How to use it:
1. Insert your images into the carousel using CSS background-image
property. The markup structure should be like this:
<div class="slide"> <ul> <li style="background-image:url(images/03.jpg)"></li> <li style="background-image:url(images/02.jpg)"></li> <li style="background-image:url(images/01.jpg)"></li> </ul> </div>
2. Add the basic CSS styles as shown below into your document.
.slide { width: 100%; height: 382px; margin: 50px auto; position: relative; overflow: hidden; } .slide ul { margin: 0 auto; height: 382px; } .slide ul li { width: 100%; list-style: none; position: absolute; z-index: 1; height: 382px; background-position: top center; top: 0; left: 0; right: 0; } .slide #dots { position: absolute; left: 0; right: 0; bottom: 10px; height: 30px; z-index: 9999; font-size: 0; text-align: center; opacity: 0.7; } .slide #dots a { background: #333; margin: 0 6px; width: 18px; height: 18px; box-shadow: 0 0 1px 0 #333; border-radius: 100%; display: inline-block; cursor: pointer; } .slide #dots a.active { background: #FFF; } .slide .arrow { position: absolute; top: 50%; width: 70px; height: 100px; margin-top: -50px; background: #FFF; z-index: 999; opacity: 0.7; line-height: 100px; color: #333; text-align: center; text-decoration: none; } .slide .arrow.prev { left: 0; } .slide .arrow.next { right: 0; } .slide .arrow:active { background: #FAFAFA; opacity: 1; }
3. Include jQuery library and the jQuery Fadeimages plugin at the bottom of the document.
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <script src="path/to/jquery.fadeImg.js"></script>
4. Call the plugin on the parent element and done.
$(".slide").fadeImages();
5. Available options with defaults.
$(".slide").fadeImages({ time: 3000, // animation delay fade: 1000, // animation speed dots: true, // dots navigation arrows: false, // display next / prev navigation complete:function(){} // callback function });
Change log:
2016-11-12
- add mouse and touch slide function
2015-10-21
- added new features: next / prev navigation
This awesome jQuery plugin is developed by TERRILLTANG. For more Advanced Usages, please check the demo page or visit the official website.