An awesome, fully responsive jQuery slider plugin.
- - Simple, semantic markup
- - Supported in all major browsers
- - Horizontal/vertical slide and fade animations
- - Multiple slider support, Callback API, and more
- - Hardware accelerated touch swipe support
- - Custom navigation options
- - Use any html elements in the slides
- - Basic slider
- - Slider w/thumbnail controlnav pattern
- - Slider w/thumbnail slider
- - Basic carousel
- - Carousel with min and max ranges
- - Video & the api (vimeo)
IMPLEMENTATION:
1. First, include CSS and jQuery files
1 2 3 4 | <!-- Place somewhere in the <head> of your document --> <link rel="stylesheet" href="flexslider.css" type="text/css" /> <script src="jquery.min.js"></script> <script src="jquery.flexslider.js"></script> |
2. Build your HTML code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!-- Place somewhere in the <body> of your page --> <div class="flexslider"> <ul class="slides"> <li> <img src="slide1.jpg" /> <p class="flex-caption">Caption, legend...</p> </li> <li> <img src="slide2.jpg" /> <p class="flex-caption">Caption, legend...</p> </li> <li> <img src="slide3.jpg" /> </li> </ul> </div> |
3. Make the plugin call
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!-- Place in the <head>, after the three links --> <script type="text/javascript" charset="utf-8"> $(window).load(function() { //simple FlexSlider call $('.flexslider').flexslider(); // more complex call $('.flexslider').flexslider({ animation: "slide", controlsContainer: ".flex-container", start: function(slider) { $('.total-slides').text(slider.count); }, after: function(slider) { $('.current-slide').text(slider.currentSlide); } }); }); </script> |
Multiple Flexslider in your page ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <!-- Somewhere in the of your page --> <div id="main-slider" class="flexslider"> <ul class="slides"> ... </ul> </div> <div id="secondary-slider" class="flexslider"> <ul class="slides"> ... </ul> </div> <!-- Target sliders individually with different properties --> <script type="text/javascript" charset="utf-8"> $(window).load(function() { $('#main-slider').flexslider({ animation: 'slide', controlsContainer: '.flex-container' }); $('#secondary-slider').flexslider(); }); </script> |
METHODS:
- start
- Function
- Callback: function(slider) - Fires when the slider loads the first slide
- before
- Function
- Callback: function(slider) - Fires asynchronously with each slider animation
- after
- Function
- Callback: function(slider) - Fires after each slider animation completes
- end
- Function
- Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
- added
- Function
- Callback: function(slider) - Fires after a slide is added
- removed
- Function
- Callback: function(slider) - Fires after a slide is removed
SCREENSHOTS
Tidak ada komentar:
Posting Komentar