JavaScriptPost your JavaScript Related Tutorial Here
Notices
Welcome to the Aio® forum.
You are currently viewing AIOFORUM as a guest which gives you VERY limited access to view most discussions, Applications, Latest Movies & Tutorials and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload and Download content and access many other special features. Registration is fast, simple and absolutely free so please, Join our community today!
If you have any problems with the registration process or your account login, please use Contact us.
A lot of blogs are now opting for a tabbed area in the sidebar which contains some of the widgets that were previously on the sidebar, this saves space and makes the interface much more manageable.
This effect is achieved with a mix of Javascript and CSS and in this tutorial I will show you how to get it set up on your site, I will be using three tabs like on Help Developer, these will be Recent Posts, Categories and Archives. This tutorial is an extension of Justin Tadlock’s post here.
Firstly download these two files: tabs.js and jquery.js
Now open your header.php file in the wordpress template that you are using and add the following code between the <head> and </head> tags:
No open the style.css file and add the following code somewhere in the stylesheet (take note of the red comments):
#sidebartabs { /* acts as the widget container */
clear:both;
width:280px; /* this was an appropriate width for my sidebar, this may be different for you. */
margin-left:10px;
margin-bottom:20px;
margin-top:0px;
display:block;
}
#sidebartabs .tabbed div a { /* This is the styling for the links inside any of the tab areas */
padding-left:3px;
padding-top:5px;
padding-bottom:5px;
display:block;
font-size:10pt;
color:#999999;
border-bottom:#ababab 1px solid;
text-decoration: none;
clear:both;
text-align:left;
margin-left:0px;
margin-right:4px;
margin-top:0;
margin-bottom:0;
width:270px;
}
#sidebartabs .tabbed div a:hover { /* This is the styling when you hover over links in the tabbed area */
color:#777777;
text-decoration: none;
}
.tabbed { /* This is the tab area container */
margin-bottom:10px;
clear:both;
margin-top:0px;
}
.tabbed ul.tabs { /* This is the styling for the tabs themselves */
float: left;
display: inline;
width: 100%;
margin: 0;
padding-bottom:10px;
padding-left:10px;
padding-right:10px;
padding-top:0px;
}
.tabbed ul.tabs li { /* Styling for each individual tab */
list-style-type: none;
float: left;
margin: 0;
padding: 0;
z-index:10;
}
.tabbed ul.tabs li a { /* Styling for the link on the tab */
overflow: hidden;
display: block;
margin: 0 1px 0 0;
padding: 10px 12px;
background-color:#efefef;
cursorointer;
}
.tabbed ul.tabs li a:hover { /* This is the styling for when you hover over a tab */
text-decoration:none;
}
.tabbed ul.tabs li a.tab-current { /* The styling for the activated tab */
background-color:#e8e8e8;
border-left:1px solid #CCCCCC;
border-right:1px solid #CCCCCC;
border-top:#cda2a2 solid 2px;
}
.tabbed div { /* This is the tab area for each tab, the inside of the tab */
float: left;
display: block;
background-color:#e8e8e8;
padding:10px;
clear:both;
width:100%;
padding-bottom:20px;
border:1px solid #CCCCCC;
border-bottom:#cda2a2 solid 2px;
margin-top:-1px;
z-index:1;
}
.tabbed div.t2, .tabbed div.t3, .tabbed div.t4 {
display: none;
}
This should produce something like the tabbed are on the Help Developer sidebar. You can change the styling above to add images to the tabs or change the sizing. You can also add more tabs by adding the following lines:
<li class=”t4″><a class=”t4 tab” title=”NewTabName”>NewTabName</a></li> under the <li class=”t3″><a class=”t3 tab” title=”Archives”>Archives</a></li>
AND THEN…