Download
User Rating: 2.9/5 ( 1 votes)
SliderTabs is a flexible, super simple jQuery plugin for sliding tabs.
Why?
The goal of SliderTabs isn't to pollute the jQuery world with another tabs plugin but to create the possibility to build tabs, slideshows, featured content sliders, and more with one plugin. I hope this will be the last plugin you'll need to create slider type widgets. It's a pretty new project so please let me know of any bugs or suggestions on the issues page!
Features
-
Fully customizable with CSS
-
Multiple panel transition effects
-
Auto height adjustment
-
Responsive design to spontaneous size changes
-
Multiple instances
-
Cross browser compatible
-
Autoplay
-
Mousewheel integration
Source: opatin.github.io
1. INCLUDE CSS AND JS FILES
<link rel="stylesheet" href="styles/jquery.sliderTabs.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.sliderTabs.min.js"></script>
2. HTML
First make a div element including first a list of links for tabs and the same number of div elements afterwards for panels. To link the div panels to the tabs, make sure that the href attribute of the tab links is '#IdOfPanel'. Note that list of tabs is required markup even if you plan on disabling tabs as other parts of the plugin like indicators depend on these declarations.
<div id="mySliderTabs">
<!-- Unordered list representing the tabs -->
<ul>
<li><a href="#canyon">The Grand Canyon</a></li>
<li><a href="#taj">The Taj Mahal</a></li>
<li><a href="#bigben">Big Ben</a></li>
</ul>
<!-- Afterwards, include the div panels representing the panels of our slider -->
<div id="canyon">
<h3>The Grand Canyon</h3>
<!-- rest of the panel content -->
</div>
<div id="taj">
<h3>The Taj Mahal</h3>
<!-- rest of the panel content -->
</div>
<div id="bigben">
<h3>Big Ben</h3>
<!-- rest of the panel content -->
</div>
</div>
3. JAVASCRIPT
var slider = $("div#mySliderTabs").sliderTabs({
autoplay: true,
mousewheel: false,
position: "bottom"
});
4. OPTIONS
Key |
Default |
Description |
autoplay |
false |
false or integer - Number of milliseconds betweeen transitions to the next tab. |
tabArrowWidth |
35 |
integer - Width in pixels of the tab arrows. |
classes |
{
leftTabArrow: '',
panel: '',
panelActive: '',
panelsContainer: '',
rightTabArrow: '',
tab: '',
tabActive: '',
tabsList: ''
}
|
Additional classes to add to important elements. Useful for custom styling. |
defaultTab |
1 |
integer - Index of the tab selected by default. (1-indexed) |
height |
null |
integer - Set a static value for the height of the whole widget in pixels. |
indicators |
false |
boolean - Show panel indicators. |
mousewheel |
true |
boolean - Allow scrolling to the next and previous panel using the mousewheel. |
position |
'top' |
'top' or 'bottom' - Position of the tabs relative to the panel container |
panelArrows |
false |
boolean - Show the next and previous panel arrows. |
panelArrowsShowOnHover |
false |
boolean - Hide the panel arrows unless the panel container is being hovered over. |
tabs |
true |
boolean - Use tabs |
tabHeight |
30 |
integer - Height in pixels of the tabs container |
tabArrows |
true |
boolean - Use tab arrows when tabs overflow out of their container. |
tabSlideLength |
100 |
integer - Number of pixels to slide the tabs when using the tab arrows. |
tabSlideSpeed |
200 |
integer - Number of milliseconds of the tab sliding transition. |
transition |
'slide' |
'slide' or 'fade' - Transition to use for panel transitions. |
transitionEasing |
'easeOutCubic' |
string - Name of the easing function to use for panel transitions. Use any easing functions included with jQuery UI. Note that there is no need to actually include jQuery UI. |
transitionSpeed |
500 |
integer - Number of milliseconds of the panel transition. |
width |
null |
integer - Set a static width in pixels for the widget. |