<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LoonDesign &#187; Javascript</title>
	<atom:link href="http://kailoon.com/category/tutorials/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://kailoon.com</link>
	<description>Tutorials . Comic . Web Design . Freelance . Blog</description>
	<lastBuildDate>Fri, 12 Mar 2010 02:06:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Tabbing System</title>
		<link>http://kailoon.com/simple-tabbing-system/</link>
		<comments>http://kailoon.com/simple-tabbing-system/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 11:00:02 +0000</pubDate>
		<dc:creator>kailoon</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://kailoon.com/?p=282</guid>
		<description><![CDATA[Today, we are going to learn how to create simple tabbing system. It is a very common technique nowadays. Especially for those magazine site, news or blogs that contain a lot of sections or contents. Tabbing system is very useful to make things look more organized and structure. I know most of you are using [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/content_image/tabbing/tabbing.png" alt="tabbing" class="float" />Today, we are going to learn how to create simple tabbing system. It is a very common technique nowadays. Especially for those magazine site, news or blogs that contain a lot of sections or contents. Tabbing system is very useful to make things look more organized and structure. I know most of you are using JQuery for it. But for me, I am using Savvy UI. Another javascript library. I use it for all my wordpress themes design and development.</p>
<h3>Mission</h3>
<p>Before this, I&#8217;ve release a tutorial about the <a href="http://kailoon.com/css-sliding-door-using-only-1-image/" target="_blank">CSS sliding door using only 1 image</a>. I will extend from there and what we need to do is to modify some codes. Before that, you can<br />
<a href="http://kailoon.com/example/tabbing/" target="_blank"><img src="/content_image/tabbing/end.png" alt="sample" class="border" /></a>. </p>
<h3>Step 1 &#8211; HTML Structure</h3>
<p>Let&#8217;s start here. This is a basic structure that we need. We need to put everything inside a div that we are going to control using the javascript. Here we use #tab. The beauty of Savvy UI is that the title of the div will be the anchor text for the tab buttons. The x-simpletab-panel is a pre-built class for the tab button within the system to make sure that the content within the div will be included in the tabbing system.</p>
<pre class="brush: xml;">
&lt;div id=&quot;tab&quot;&gt;
	&lt;div id=&quot;tab-home&quot; title=&quot;Home&quot; class=&quot;x-simpletab-panel&quot;&gt;
        &lt;!--content goes here--&gt;home content
        &lt;/div&gt;&lt;!--tab-home end--&gt;

	&lt;div id=&quot;tab-products&quot; title=&quot;Products&quot; class=&quot;x-simpletab-panel&quot;&gt;
        &lt;!--content goes here--&gt;products content
        &lt;/div&gt;&lt;!--tab-product end--&gt;

	&lt;div id=&quot;tab-blog&quot; title=&quot;Blog&quot; class=&quot;x-simpletab-panel&quot;&gt;
        &lt;!--content goes here--&gt;blog content
        &lt;/div&gt;&lt;!--tab-blog end--&gt;

	&lt;div id=&quot;tab-contact&quot; title=&quot;Contact&quot; class=&quot;x-simpletab-panel&quot;&gt;
        &lt;!--content goes here--&gt;contact content
        &lt;/div&gt;&lt;!--tab-contact end--&gt;
&lt;/div&gt;
</pre>
<h3>Step 2 &#8211; CSS</h3>
<p>For the css part, we will need to create something to suit the system. There will be several auto-generated class for the ul, li and div that we use.</p>
<pre class="brush: css;">
body {
	padding: 20px;
	margin: 0;
	color: #666;
	font: 400 80%/150% Verdana, Arial, Helvetica, sans-serif;
}

.simpletab-toolbar-container { /*container for the tab buttons*/
	float: left;
	width: 100%;
}

ul.simpletab-toolbar { /*auto generated ul with specified class */
	padding: 0;
	margin: 0;
	list-style: none;
	background-color: #fff;
	float: left;
	clear: left;
}

ul.simpletab-toolbar li {
	float: left;
}

ul.simpletab-toolbar li a {
	float: left;
	text-decoration: none;
	color: #ccc;
	padding: 4px 15px 0 0;
	margin-right: 8px;
	font: 900 14px &quot;Arial&quot;, Helvetica, sans-serif;
}

ul.simpletab-toolbar li a em { /*auto generated em, the useage is same with what we used for the sliding dor as span */
	float: left;
	padding-right: 15px;
	display: block;
	margin-top: -4px;
	height: 24px;
}

ul.simpletab-toolbar li a:hover {
 	color: #0d5f83;
	background: url(&quot;images/blue.png&quot;) no-repeat top right;
}

ul.simpletab-toolbar li a:hover em {
	background: url(&quot;images/blue.png&quot;) no-repeat top left;
}

ul.simpletab-toolbar li a.current {
	background: url(&quot;images/blue.png&quot;) no-repeat top right;
 	color: #0d5f83;
}

ul.simpletab-toolbar li a.current em {
	background: url(&quot;images/blue.png&quot;) no-repeat top left;
}

.simpletab-container { /*auto generated class for the content container */
	margin-top: 10px;
	float: left;
}

.simpletab-container .simpletab-active { /*auto generated class for the active content container */
	display: block;
}

.simpletab-container .simpletab-hidden { /*auto generated class for the in-active content container */
	display: none;
}
</pre>
<h3>Step 3 &#8211; Download the Library and Implement</h3>
<p>We need to build the <a href="http://savvyui.com/download/build/">Library</a> that we need and implement into the codes. What we need is only the Simple Tab under Utilities. Then, implement into our system.</p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; src=&quot;savvy-build.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
		SUI(document).ready(function(){
    		new SUI.Util.SimpleTab(&quot;#tab&quot;);
		});
	&lt;/script&gt;                                

/*before the head close tag*/
</pre>
<p><a href="http://kailoon.com/example/tabbing/basic.php" target="_blank">The result so far.</a></p>
<h3>Step 4 &#8211; Structure The Contents</h3>
<p>Now, let&#8217;s try to add in some content and style it in what you like. Below is my example for it.</p>
<pre class="brush: xml;">
&lt;h1&gt;&lt;a href=&quot;#&quot;&gt;Simple Tab Using Savvy.UI&lt;/a&gt;&lt;/h1&gt;
&lt;div id=&quot;tab&quot;&gt;
&lt;div id=&quot;tab-home&quot; title=&quot;Home&quot; class=&quot;x-simpletab-panel&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;h3&gt;Home&lt;/h3&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;p&gt;&lt;!--content goes here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--post end--&gt;
&lt;/div&gt;&lt;!--content end--&gt;
&lt;/div&gt;&lt;!--tab-home end--&gt;

&lt;div id=&quot;tab-products&quot; title=&quot;Products&quot; class=&quot;x-simpletab-panel&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;h3&gt;Products&lt;/h3&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;p&gt;&lt;!--content goes here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--post end--&gt;
&lt;/div&gt;&lt;!--content end--&gt;
&lt;/div&gt;&lt;!--tab-priduct end--&gt;

&lt;div id=&quot;tab-blog&quot; title=&quot;Blog&quot; class=&quot;x-simpletab-panel&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;h3&gt;Post Title 1&lt;/h3&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;p&gt;&lt;!--content goes here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--post end--&gt;
&lt;/div&gt;&lt;!--content end--&gt;
&lt;/div&gt;&lt;!--tab-blog end--&gt;

&lt;div id=&quot;tab-contact&quot; title=&quot;Contact&quot; class=&quot;x-simpletab-panel&quot;&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;h3&gt;Contact&lt;/h3&gt;
&lt;div class=&quot;post&quot;&gt;
&lt;p&gt;&lt;!--content goes here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--post end--&gt;
&lt;/div&gt;&lt;!--content end--&gt;
&lt;/div&gt;&lt;!--tab-contact end--&gt;

&lt;/div&gt;</pre>
<h3>Step 5- CSS Again</h3>
<p>After that, apply some CSS for it.</p>
<pre class="brush: css;">
#tab {
	clear: left;
	width: 100%;
}

.content {
	border: 1px solid #59b9e8;
	background-color: #e0eef4;
	margin-bottom: 15px;
}

.post {
	padding: 0 10px;
}

h3 {
	background: url(images/header.png) repeat-x top left;
	height: 30px;
	font: 900 20px &quot;Times New Roman&quot;, Times, serif;
	color: #fff;
	margin: 0;
	padding: 2px 0 0 10px;
}

body {
	padding: 20px;
	margin: 0;
	color: #666;
	font: 400 80%/150% Verdana, Arial, Helvetica, sans-serif;
}

p {
	padding: 0 0 12px 0;
}

h1 a {
	font: 900 200% &quot;trebuchet MS&quot;;
	color: #59B9E8;
	letter-spacing: -1px;
	margin: 0;
	text-decoration: none;
}

h1 a:hover {
	color: #09f;
}
</pre>
<h3>Conclusion and Download</h3>
<p>It is simple and easy to do. Again, here is the <a href="http://kailoon.com/example/tabbing/" target="_blank">end result</a>. And below is the download for the source files that I used. Cheers!</p>
<div class="interact">
<a href="http://kailoon.com/download/tabbing.zip"><img src="http://kailoon.com/download/download.jpg" alt="Download" /></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://kailoon.com/simple-tabbing-system/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
