Slider
Summary
The Slider plugin was developed out of the shear need for a slider that is more intuitive to the CSS that is being applied to it. In a project I had for a client, not many other sliders were adapting well with the styling that I needed to apply to it.
Download
jQuery Slider Plugin (3185)Demo
Documentation
Base
For the basic implementation, create an element (ie. UL or DIV), and child elements (ie. LI or DIV). NOTE: In the demos there are wrapper DIVs that are only used to style each slider separately.
or
or even
Implementation
To add a Slider very few lines of code are actually need. Load the jQuery library, be sure to have a simple parent > children structure, and apply the plug-in as follows:
1 2 3 | $(function() { $('ul').slider(); }); |
Settings
If you wanted to add some settings to further customize your Slider, following are the settings, their defaults, as well as a brief explanation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $(function() { $('ul').slider({ transition : 'slide', easing : 'swing', direction : 'horizontal', speed : 500, auto : false, interval : 2000, hoverPause : true, navigation : true, buttons : true, prevText : 'Previous', nextText : 'Next', loop : true }); }); |
Transition: You can choose to have it ‘slide‘, ‘fade‘ or just ‘cut‘ between slides. Defaults to ‘slide‘.
Easing: Whether you want to use jQuery’s ‘swing‘ or ‘linear‘, or you can add other easing options available with the Easing plugin. Defaults to ‘swing‘.
Direction: Allows you to choose between sliding the panes in a ‘horizontal‘ or ‘vertical‘ fashion. Defaults to ‘horizontal‘.
Speed: The duration of the transition (in milliseconds). Defaults to 500.
Auto: If set to TRUE, the slider will auto-advance. Defaults to FALSE.
Interval: The time in milliseconds between each animation, if Auto is set to TRUE.
Hover Pause: When the auto-advance is on, hovering will cause auto-advance to pause until the mouse is no longer hovering. Defaults to TRUE.
Navigation: Creates a navigation list for the slider. By default, each ‘tab’ has the frame number in which it will transition to on click. If a frame has a title, that will also be appended to the number (there are some CSS hooks to better style these. If set to FALSE, no navigation will display. Defaults to TRUE.
Buttons: If set to FALSE, no buttons will display. If so, it is then recomended that Auto is set to TRUE. Defaults to TRUE.
Prev Text: Change the text on the Previous button. Defaults to ‘Previous‘.
Next Text: Change the text on the Next button. Defaults to ‘Next‘.
Loop: If set to true, a transition to the next slide while being on the last slide will trigger going back to the beginning, and vice-versa. Defaults to TRUE.
CSS
There are a few changes to the DOM that Slider makes. It uses a very basic naming convention. To modify the CSS, there are a few hooks that will make coding much easier (the classes in parenthesis are conditional).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | .slider-wrapper .slider-control-prev(.disabled) .slider-control-next(.disabled) .slider-control-navigation .slider-control-navigation-tab(.current) .slider-boundary .slider-container .slider-slide |
Donate
If you’ve felt this project has benefitted you, you might considering donating. Every cent is very much appreciated!
- Share this:
-
tri
-
http://jstnjns.com/ JSTNJNS
-
http://jstnjns.com/ JSTNJNS
-
Bowman
-
Ish
-
http://jstnjns JSTNJNS
-
http://jstnjns JSTNJNS
-
Jörg
-
Jörg
-
http://www.kick-image.at/weblog/27-04-2010/jquery-plugin-simple-slider jQuery Plugin ‘Simple Slider’ – Weblog – Webdesign- Agentur kick-image.at – High End Webdesign – Linz, Austria, Europe
-
http://www.jstnjns.com/ Justin
-
http://www.raghibsuleman.com/ Raghib Suleman
-
Aaron-healey
-
Aaron-healey
-
Allanb
-
http://www.jstnjns.com/ JSTNJNS
-
Allanb
-
http://dini.hu/blog/wordpress/featured-content-gliderslider/ Featured Content Glider/Slider | Csak magamnak
-
Hesam
-
http://www.jstnjns.com/ JSTNJNS
-
http://pulse.yahoo.com/_7NDKVC2YRR3CPM4G6WZHKWLHWY Ackryl
-
Kim