Smart Tab is a flexible jQuery(a JavaScript library) Tab Control plugin.
Current Version : 0.99
Screenshots:
Demo:
1. Basic Layout view demo
2. Vertical Layout view demo
2. Bottom Layout view demo
Download:
Version - 0.99(SmartTab - 0.99.zip) Download file from SourceForge
Features:
- Customizable tab anchors, can use images.
- AutoProgress:- option for automatic navigation of tabs.
- AutoProgress can be stopped when mouse hover on control and restarts when not.
- Keyboard Navigation:- Use left/right keyboard keys to navigate through tabs(try on demo).
- Transition Effects:- option for fade/slide effects on tab transition.
- Option for specifying the selected tab.
- Easly can impliment Top, Bottom and Vertical style layout(see the demo).
- Easy to implement, Minimal HTML required.
Basic Usage:
With option parametrs:$('#tabs').smartTab();
Installing Smart Tab:$('#tabs').smartTab({ selected: 0, // Selected Tab, 0 = first step keyNavigation:true, // Enable/Disable key navigation autoProgress:false, // Auto navigate tabs on interval progressInterval: 3500, // Auto navigate Interval stopOnFocus:false, // Stops autoProgress on mouse hover and restarts when not transitionEffect:'none', // Effect on navigation, none/fade/slide tabContainerClass:'stContainer' // tab container css class name });
Step 1: Get the latest version of jQuery(www.jquery.com)
Step 2: Download the Smart Tab (http://tech-laboratory.blogspot.com)
Step 3: Include following lines to head section of your html file (Make sure that the path to the files are correct).
Step 4: Copy the below lines to your head section<link href="styles/smart_tab.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/jquery.smartTab.js"></script>
Step 5: Copy the below html to the body section.<script type="text/javascript"> $(document).ready(function(){ $('#tabs').smartTab(); }); </script>
Finished: That all, you are set to Go. I'm happy to hear comments and feedback from you. Happy Coding!!!<div id="tabs" class="stContainer"> <ul> <li><a href="#tabs-1"> <img class='logoImage2' border="0" width="50px" src="images/Step1.png"> <h2>Tab 1<br /> <small>Description</small></h2> </a></li> <li><a href="#tabs-2"> <img class='logoImage2' border="0" width="50px" src="images/Step2.png"> <h2>Tab 2<br /> <small>Description</small></h2> </a></li> <li><a href="#tabs-3"> <img class='logoImage2' border="0" width="50px" src="images/Step3.png"> <h2>Tab 3<br /> <small>Description</small></h2> </a></li> <li><a href="#tabs-4"> <img class='logoImage2' border="0" width="50px" src="images/Step4.png"> <h2>Tab 4<br /> <small>Description</small></h2> </a></li> </ul> <div id="tabs-1"> <h2>Tab 1 Title</h2> <p>Tab 1 Content here</p> </div> <div id="tabs-2"> <h2>Tab 2 Title</h2> <p>Tab 2 Content here</p> </div> <div id="tabs-3"> <h2>Tab 3 Title</h2> <p>Tab 3 Content here</p> </div> <div id="tabs-4"> <h2>Tab 4 Title</h2> <p>Tab 4 Content here</p> </div> </div>
16 comments:
Nice plugin, thank you!
if you write:
line 19: var tabs = $("ul:first > li > a", obj);
instead of
line 19: var tabs = $("ul > li > a", obj);
you can nest tabs :)
line 19: var tabs = $("> ul > li > a", obj);
is even better, because you can define more "tab rows".
if you write:
line 17: var obj = $(this);
instead of
line 17: obj = $(this);
you can use more than one tab element in the same page
Hi Tim/Fair
Thanks a lot for your helpful suggestions,
and i will implement it on the next installment
of Smart Tab
Thank you once again...
Thanks. I personally used this amazing script in my site.
Thank you and keep up the hard work ...
How I can change slide speed?
Thanks
If you want to change the progress speed you can use
$('#tabs').smartTab({autoProgress: true, progressInterval: 2500);
Or if you want to change the slide animation speed you need to modify the plugin file (jquery.smartTab.js).
In the file you can search for 'slideDown' and 'slideUp' so the results will be like
$($(selTab, obj).attr("href"), obj).slideDown("slow");
$($(selTab, obj).attr("href"), obj).slideUp("slow",showTab);
in all these lines you can change the first parameter of slideDown and slideUp to change the animation speed. Currently its 'slow', but you can use 'slow', 'fast' or supply values in milliseconds like 200, 600 etc.
Hello. Thank you for this plugin!
How can I switch to for example tab 1 using javascript, please?
Thank you.
Do you mean external anchors for the tab navigation? then the current version does not
support that option. But you can modify the code to implement it.
Found one way of doing it:
Modify jquery.smartTab.js after line 28, add:
$(obj).bind ("goto_tab", function (e, arg) {
var prevTabIdx = curTabIdx;
curTabIdx = arg;
hideTab(prevTabIdx);
});
Result should look like:
hideAllSteps(); // Hide all content on the first load
showTab();
$(obj).bind ("goto_tab", function (e, arg) {
var prevTabIdx = curTabIdx;
curTabIdx = arg;
hideTab(prevTabIdx);
});
....
After that on the page, you can call:
$('#tabs').trigger ("goto_tab", 0);
$('#tabs').trigger ("goto_tab", 1);
etc.
Does the Smart Tab have any negative effects on SEO?
Excellent control, but how can I centre the control if using a horizontal display? I have tried placing the control within a div with style="text-align:center" however the control keeps it self aligned to the left and I cannot force it into the middle of my page.
Thanks
Tom
hi, this is very good plugin.
but how can I insert more div into div content(id="tabs-1")?
thank you!
Uncaught TypeError: Object [object Object] has no method 'smartTab'
Hi
I am facing problem with smartTab jquery. Can you please tell me that how we can set one extra div above all the div and want to open that div by default.
So please help to doing this . Its urgent
Thanks
how to implement pagination inside of tab? is that possible? help me
Post a Comment