<?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>Jeffri Hong &#187; Designing</title>
	<atom:link href="http://jeffri.net/category/designing/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeffri.net</link>
	<description> </description>
	<lastBuildDate>Thu, 05 Apr 2012 23:49:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Simple jQuery and CSS3 Slideshow Tabs</title>
		<link>http://jeffri.net/2010/10/simple-jquery-and-css3-slideshow-tabs/</link>
		<comments>http://jeffri.net/2010/10/simple-jquery-and-css3-slideshow-tabs/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 01:00:21 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=688</guid>
		<description><![CDATA[A slideshow and tabs is pretty common nowadays in any modern website. There is a ton of way to do this and many free and paid tools available for this feature. This make it very easy to create and it will always amaze people who see it. Basically, we will need at least Javascript to [...]]]></description>
			<content:encoded><![CDATA[<p>A slideshow and tabs is pretty common nowadays in any modern website. There is a ton of way to do this and many free and paid tools available for this feature. This make it very easy to create and it will always amaze people who see it. Basically, we will need at least Javascript to do this, CSS to style the slideshow and tabs as we wanted, and then finally the special HTML markup which make it possible. There is also a slideshow which make use of Flash.</p>
<p>The solution I tried to made right now is a very simple and basic one. It make use of simple jQuery to catch the click event and switching tabs, as well as the slideshow, the CSS to style it as much as we wanted and a simple HTML markup in one <em>unordered list</em>.</p>
<p><img src="http://jeffri.net/wp-content/uploads/slideshow-tabs.jpg" alt="" title="slideshow-tabs" width="540" height="300" class="alignnone size-full wp-image-689" /></p>
<p><span id="more-688"></span></p>
<h3>The Markup</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>ul <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tabs tabs-1&quot;</span><span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-select&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#tab1&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab1&quot;</span><span style="color: #339933;">&gt;</span> 
			<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-images/tab1.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 1&quot;</span> <span style="color: #339933;">/&gt;</span> 
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-select&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#tab2&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab2&quot;</span><span style="color: #339933;">&gt;</span> 
			<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-images/tab2.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 2&quot;</span> <span style="color: #339933;">/&gt;</span> 
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-select&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#tab3&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab3&quot;</span><span style="color: #339933;">&gt;</span> 
			<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-images/tab3.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 3&quot;</span> <span style="color: #339933;">/&gt;</span> 
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-select&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#tab4&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span> 
		<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab4&quot;</span><span style="color: #339933;">&gt;</span> 
			<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tab-images/tab4.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 4&quot;</span> <span style="color: #339933;">/&gt;</span> 
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span> 
<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>The markups is as simple as it can get. It consists of an <em>un-ordered list</em>, with each list containing one <em>anchor</em> for navigation and one <em>div</em> for content.</p>
<h3>The Javascripts</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span> 
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> 
	jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ready<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.tabs'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li:first'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>addClass<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the first tab to display</span>
			repeat_slideshow<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.tabs li .tab-select'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>click<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>closest<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.tabs'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>not<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>removeClass<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// hide all tabs except for the current</span>
			$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>addClass<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the current tab to display</span>
			reset_slideshow<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>closest<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.tabs'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">function</span> slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> index <span style="color: #339933;">=</span> slide<span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li.current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>index<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">var</span> total <span style="color: #339933;">=</span> slide<span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>length<span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> index<span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">&gt;=</span> total <span style="color: #009900;">&#41;</span>
				<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #990000;">next</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">else</span>
				<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #990000;">next</span> <span style="color: #339933;">=</span> index <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			slide<span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li.current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>removeClass<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			slide<span style="color: #339933;">.</span>find<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>eq<span style="color: #009900;">&#40;</span><span style="color: #990000;">next</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>addClass<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">function</span> repeat_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			slide<span style="color: #339933;">.</span>data<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'slideshow'</span><span style="color: #339933;">,</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					repeat_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5000</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">function</span> stop_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			clearTimeout<span style="color: #009900;">&#40;</span>slide<span style="color: #339933;">.</span>data<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'slideshow'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">function</span> reset_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			stop_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			repeat_slideshow<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></td></tr></table></div>

<p>This code is pretty much simple, it only toggles tab by changing <em>class</em> properties. It relies to the CSS to deliver the actual tabs toggling.</p>
<h3>The CSS</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span> 
	<span style="color: #339933;">.</span>tabs
	<span style="color: #009900;">&#123;</span>
		position<span style="color: #339933;">:</span> relative<span style="color: #339933;">;</span>
		height<span style="color: #339933;">:</span> 430px<span style="color: #339933;">;</span>
		width<span style="color: #339933;">:</span> 640px<span style="color: #339933;">;</span>
		list<span style="color: #339933;">-</span>style<span style="color: #339933;">-</span>type<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
		margin<span style="color: #339933;">:</span> 10px <span style="color: #cc66cc;">0</span> 40px<span style="color: #339933;">;</span>
		padding<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		overflow<span style="color: #339933;">:</span> hidden<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs<span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span>
	<span style="color: #009900;">&#123;</span>
		width<span style="color: #339933;">:</span> 380px<span style="color: #339933;">;</span>
		padding<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> 260px<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li
	<span style="color: #009900;">&#123;</span>
		float<span style="color: #339933;">:</span> left<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>select
	<span style="color: #009900;">&#123;</span>
		display<span style="color: #339933;">:</span> block<span style="color: #339933;">;</span>
		float<span style="color: #339933;">:</span> left<span style="color: #339933;">;</span>
		margin<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span> 5px <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		padding<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span> 10px<span style="color: #339933;">;</span>
		background<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#e6e6e6;
</span>		color<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#666;
</span>		text<span style="color: #339933;">-</span>decoration<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
		cursor<span style="color: #339933;">:</span> pointer<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs<span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> li <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>select
	<span style="color: #009900;">&#123;</span>
		height<span style="color: #339933;">:</span> 20px<span style="color: #339933;">;</span>
		line<span style="color: #339933;">-</span>height<span style="color: #339933;">:</span> 20px<span style="color: #339933;">;</span>
		<span style="color: #339933;">-</span>moz<span style="color: #339933;">-</span>border<span style="color: #339933;">-</span>radius<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
		border<span style="color: #339933;">-</span>radius<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
		font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>content
	<span style="color: #009900;">&#123;</span>
		position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
		top<span style="color: #339933;">:</span> 30px<span style="color: #339933;">;</span>
		left<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		height<span style="color: #339933;">:</span> 400px<span style="color: #339933;">;</span>
		width<span style="color: #339933;">:</span> 640px<span style="color: #339933;">;</span>
		opacity<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">-</span>moz<span style="color: #339933;">-</span>transition<span style="color: #339933;">:</span> opacity 0<span style="color: #339933;">.</span>5s linear<span style="color: #339933;">;</span>
		<span style="color: #339933;">-</span>o<span style="color: #339933;">-</span>transition<span style="color: #339933;">:</span> opacity 0<span style="color: #339933;">.</span>5s linear<span style="color: #339933;">;</span>
		<span style="color: #339933;">-</span>webkit<span style="color: #339933;">-</span>transition<span style="color: #339933;">:</span> opacity 0<span style="color: #339933;">.</span>5s linear<span style="color: #339933;">;</span>
		transition<span style="color: #339933;">:</span> opacity 0<span style="color: #339933;">.</span>5s linear<span style="color: #339933;">;</span>
		z<span style="color: #339933;">-</span>index<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>select<span style="color: #339933;">:</span>hover
	<span style="color: #009900;">&#123;</span>
		background<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#ccc;
</span>		color<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#666;
</span>	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li<span style="color: #339933;">.</span><span style="color: #990000;">current</span> <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>select
	<span style="color: #009900;">&#123;</span>
		background<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#666;
</span>		color<span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">#fff;
</span>		text<span style="color: #339933;">-</span>shadow<span style="color: #339933;">:</span> 1px 1px <span style="color: #666666; font-style: italic;">#000;
</span>	<span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">.</span>tabs li<span style="color: #339933;">.</span><span style="color: #990000;">current</span> <span style="color: #339933;">.</span>tab<span style="color: #339933;">-</span>content
	<span style="color: #009900;">&#123;</span>
		opacity<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		z<span style="color: #339933;">-</span>index<span style="color: #339933;">:</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>The CSS define how the tabs will looks. It is mainly used the <em>position</em> properties to maintain the position of the tab content and leave the navigation to static position (either floated or none). Notice the <em>tabs-1</em> class? That is to demonstrate that even with this approach, we can customize the tab to different looks with exactly same markup structure.</p>
<p>To further explain how it works, first the main <em>.tabs</em> class is considered the area which the content will be placed, we set the <em>position</em> to <em>relative</em> and make sure it had enough <em>height</em> to accomodate the content. Then each <em>list</em> is <em>floated</em> to left, as well as the <em>.tab-select</em> <em>anchor</em> for navigation (in later example, we can also use <em>div</em>).</p>
<p>The content part of each list is set to <em>absolute position</em>. That means, they will overlap each other and make them in always same position. We then used <em>opacity</em> to hide and displaying the content with addition of the CSS3 <em>transform</em> to provide fading animation. Finally, we bring the selected content to the front by applying a bigger <em>z-index</em> value.</p>
<p>Note that, for fading animation, we used the <em>opacity</em> property. If you wanted to use another animation, you need to change it. For no animation, just use <em>display: none</em> and <em>display: block</em>.</p>
<h3>Why this approach?</h3>
<p>What make this approach better than any others tabs and slideshow?</p>
<p>Well, it might not better. It just that, it is simple and clean enough, at least for me.</p>
<h3>Only one <em>unordered list</em> markup needed</h3>
<p>Often, I find that a tab are made from two group of <em>lists</em> (when I said <em>lists</em> it can be a group of <em>div</em>, <em>li</em>, or anything). One is for the tab navigation and the other is for the content. Nothing is wrong either way, but I find it easier to create if it is only made on one <em>list</em>. This also apply when we create the markup on the fly using server script such as PHP. If we have two group of <em>lists</em>, this means we need to loop the variable twice, while using one <em>list</em> will only need one loop.</p>
<p>Using one list will also make the HTML cleaner and for those who browsing with text browser, it will degrade gracefully.</p>
<h3>Lighter, no Javascript effect</h3>
<p>I don&#8217;t know if this will be considered a good thing or not, but I don&#8217;t use any animation using Javascript nor jQuery effect. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Instead, I rely on CSS 3 transition for the <em>fade in</em> effect. This, obviously, is not yet a good practice. It is safe to use CSS 3 feature right now, but the lack of browser support make it not yet practical. By far, only new Webkit browser (Safari and Chrome), Opera 10.6+ and Firefox 4 support CSS transition.</p>
<p>Again, why CSS 3? Well, we know that the animation and transition in CSS 3 is not yet matured and experimental for now. It even lagged when we are doing some heavy animation. But when it is matured enough and become a standard, it will be better than any Javascript animation as it will build natively to the browser.</p>
<h3>Support multiple slideshow tabs</h3>
<p>Well, it make use of two jQuery features that was there but seems to rarely used. They are <a href="http://api.jquery.com/index/">jQuery.index</a> and <a href="http://api.jquery.com/data/">jQuery.data</a>. We used jQuery.index to see the current index from the <em>list</em> group to find the next tab to slide. It is more simple than storing a variable and keep it updated when the slide change. Then, the jQuery.data is used to store the setTimeout variable. Why using a jQuery.data and not a variable? jQuery.data allow us to attach data to a DOM element, this way, we can attach each setTimeout variable to the parent group and make it separated to any other slideshow in the same page. So, it support multiple slideshow in the same page without interrupting each other in just a few lines of code. Nice!</p>
<h3>The Downside</h3>
<p>After all this goodness, obviously, there is still a downside to be considered that it might not suit your need. First of all, the content height is fixed. This is because the use of <em>absolute position</em> for the content. Second, well, the lack CSS3 support on some web browser.</p>
<h3>The Demo</h3>
<p>Finally, a demo to show you how it actually works.</p>
<p><a href="http://www.keaglez.com/projects/slideshowtabs">Check out the demo here.</a></p>
<p>There is three styles of the slideshow tabs in the demo, so you can see that it is possible to style it in many way to suit your design.</p>
<p>The code is released under GNU General Public License. So feel free to use and modify it in any way you need.</p>
<h3>Browser support?</h3>
<p>Well, not much browser support this yet. It degrade nicely though. If you open it in older browser that didn&#8217;t have CSS 3, it still working all fine except the CSS 3 goodies. So we can say that the CSS 3 goodies is an extra for dude who love using updated browser. <img src='http://jeffri.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>How about Internet Explorer 6? Well, it is not working right as far as I can see. But I think there will be a workaround to solve the IE 6 problem though, but I just don&#8217;t have a time to spend on this <em>stupid</em> outdated browser.</p>
<h3>Final?</h3>
<p>Thank you and hope that useful for you. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2010/10/simple-jquery-and-css3-slideshow-tabs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blog redesign</title>
		<link>http://jeffri.net/2010/07/blog-redesign/</link>
		<comments>http://jeffri.net/2010/07/blog-redesign/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 01:46:22 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=553</guid>
		<description><![CDATA[Welcome to my new redesigned blog! It&#8217;s been a year and a half since the last time I changed the design. I have always wanted to change it, but I just always don&#8217;t have enough time. I know I&#8217;m not that good enough in designing, but at least, this is the best design I ever [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to my new redesigned blog! It&#8217;s been a year and a half since the last time I changed the design. I have always wanted to change it, but I just always don&#8217;t have enough time. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I know I&#8217;m not that good enough in designing, but at least, this is the best design I ever made until now!</p>
<p><img src="http://jeffri.net/wp-content/uploads/blog_design.jpg" alt="" title="blog_design" width="560" height="238" class="alignnone size-full wp-image-554" /></p>
<p>The idea behind this design is, to make a simple, usable layout and still looks beautiful. There is a lot of tutorial on the web that helped me when making this. I try to make the website small in size, so you&#8217;ll able to load it fast enough. There is also a cool trick on the background, which still make the markup small without much wrapping div over div to accomplish the effect. I also realize the importance on social networking nowadays, so I add links to some of my account. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-553"></span></p>
<p>With CSS 3 coming, I won&#8217;t forget to add some CSS 3 elements. I add a little transition, on the sidebar links and the social network icon above. You won&#8217;t see it if you don&#8217;t use webkit browser though, so if you use Google Chrome 5 and Safari 5, then you are in. This transition have no importance at all, the purpose is just to enrich the user experience, but won&#8217;t lose any functionality without it. Another CSS 3 property I used is the <em>border-radius</em>. I used this on some input fields you can find. There is also some jQuery here, although I&#8217;m only using it on input fields now, it might become handy in future.</p>
<p>While I haven&#8217;t check this on all browser yet, but I&#8217;m sure it will work fine on all major browser, includes Internet Explorer 8, Mozilla Firefox 3.6, Opera 10, Google Chrome 5 and Safari 5. While I&#8217;m not supporting older Internet Explorer version, it still, on some basic level, works fine. I even can confirm that the IE 7 load almost everything fine, but it just not perfect yet. I have some issues on the logo and button, same as IE 6. This might get fixed soon. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I wish I could write the process on making this design. I might be able write it, but I won&#8217;t promise that. In short, there is 2 steps at least. First is design it in PSD, the second is convert it to WordPress. I&#8217;m skipping the step to convert it to XHTML/CSS first though, well, that&#8217;s just how I work. <img src='http://jeffri.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I hope you will have one or two minute to type down a comment to share your opinion, so I can get better. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2010/07/blog-redesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Stick Figure with CSS 3 and jQuery</title>
		<link>http://jeffri.net/2010/06/moving-stick-figure-with-css-3-and-jquery/</link>
		<comments>http://jeffri.net/2010/06/moving-stick-figure-with-css-3-and-jquery/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 11:23:21 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS 3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=517</guid>
		<description><![CDATA[With CSS 3, creating a stick figure is easy and fun. But it is even better if it can move. So here it is Click here for the demo. This currently worked on Google Chrome and Safari. However, in my test, Safari lagged a lot in the animation. So Google Chrome performed the best! Enjoy&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>With CSS 3, creating a stick figure is easy and fun. But it is even better if it can move. So here it is</p>
<p><img src="http://jeffri.net/wp-content/uploads/stickfigure.jpg" alt="" title="Stick Figure" width="400" height="161" class="alignnone size-full wp-image-518" /></p>
<p><a href="http://www.keaglez.com/projects/stickfigure">Click here for the demo.</a></p>
<p>This currently worked on Google Chrome and Safari. However, in my test, Safari lagged a lot in the animation. So Google Chrome performed the best!</p>
<p>Enjoy&#8230; <img src='http://jeffri.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Update: This is also submitted on <a href="http://www.smashingmagazine.com/2010/07/12/css3-design-contest-results">Smashing Magazine CSS 3 Contest</a>, you can preview and download from there too. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2010/06/moving-stick-figure-with-css-3-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pure CSS Dropdown with a Little CSS 3 Juice</title>
		<link>http://jeffri.net/2010/06/pure-css-dropdown-with-a-little-css-3-juice/</link>
		<comments>http://jeffri.net/2010/06/pure-css-dropdown-with-a-little-css-3-juice/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 08:28:55 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=502</guid>
		<description><![CDATA[Menu dropdown is one of the feature that almost every today webs have and it is one of the most popular feature used in the web. In past, such feature need Javascript event. Such as using onMouseOver or onMouseOut event. However, since CSS introduced, the new psuedo classes now have this ability. Also, this solution [...]]]></description>
			<content:encoded><![CDATA[<p>Menu dropdown is one of the feature that almost every today webs have and it is one of the most popular feature used in the web. In past, such feature need Javascript event. Such as using <em>onMouseOver</em> or <em>onMouseOut</em> event. However, since CSS introduced, the new psuedo classes now have this ability. Also, this solution is work for all major browser, except, of course for the CSS3 juice added, which is currently only worked on web-kit browser such as Chrome and Safari. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-502"></span></p>
<p>Here is the menu result</p>
<style type="text/css">
	#example-dropdown-menu
	{
		background: #000;
		height: 30px;
		list-style-type: none;
		margin: 0;
		padding: 0;
	}
	#example-dropdown-menu > li
	{
		background: #333;
		float: left;
		height: 30px;
		line-height: 30px;
		margin: 0;
		padding: 0 15px;
		position: relative;
	}
	#example-dropdown-menu > li:hover
	{
		background: #666;
	}
	#example-dropdown-menu > li > a
	{
		text-decoration: none;
		color: #fff;
		display: block;
	}
	#example-dropdown-menu > li > ul
	{
		list-style-type: none;
		background: #f6f6f6;
		border-left: 1px solid #666;
		border-right: 1px solid #666;
		border-bottom: 1px solid #666;
		border-bottom-left-radius: 5px 5px;
		border-bottom-right-radius: 5px 5px;
		-moz-border-radius-bottomright: 5px 5px;
		-moz-border-radius-bottomleft: 5px 5px;
		position: absolute;
		width: 150px;
		margin: 0;
		padding: 0;
		top: 30px;
		left: 0;
		opacity: 0;
		-webkit-transition-property: opacity;
		-webkit-transition-duration: 0.5s;
		visibility: hidden;
	}
	#example-dropdown-menu > li:hover > ul
	{
		opacity: 1;
		visibility: visible;
	}
	#example-dropdown-menu > li > ul > li
	{
		height: 25px;
		line-height: 25px;
		padding: 0 15px;
	}
	#example-dropdown-menu > li > ul > li:hover
	{
		background: #666;
	}
	#example-dropdown-menu > li > ul > li > a
	{
		text-decoration: none;
		color: #666;
		display: block;
	}
	#example-dropdown-menu > li > ul > li:hover > a
	{
		color: #fff;
	}
</style>
<div style="height:120px;padding:10px;">
<ul id="example-dropdown-menu">
<li>
		<a href="#">Menu 1</a></p>
<ul>
<li><a href="#">Sub Menu 1</a></li>
<li><a href="#">Sub Menu 2</a></li>
<li><a href="#">Sub Menu 3</a></li>
</ul>
</li>
<li>
		<a href="#">Menu 2</a></p>
<ul>
<li><a href="#">Sub Menu 1</a></li>
<li><a href="#">Sub Menu 2</a></li>
<li><a href="#">Sub Menu 3</a></li>
</ul>
</li>
<li>
		<a href="#">Menu 3</a></p>
<ul>
<li><a href="#">Sub Menu 1</a></li>
<li><a href="#">Sub Menu 2</a></li>
<li><a href="#">Sub Menu 3</a></li>
</ul>
</li>
</ul>
</div>
<div style="clear:both;"></div>
<p>This is pure CSS, without any single Javascript involved. If you was using webkit browser, you will see a nice transition effect. The CSS 3 juice added here is <em>border-radius</em>, <em>transition-property</em> and <em>transition-duration</em>.</p>
<p>The trick for dropdown is done by using relative and absolute positioning. As you might know already, absolute position element is positioned relative to the parent that has position other than static. So, if we have relative position as the parent, absolute position element will get the position relative to the parent.</p>
<p>To hide and show the absolute child element, we use the <em>:hover</em> state. This worked fine on all major browser, except for the old IE 6, since the IE 6 can&#8217;t have <em>:hover</em> state work on all other element than <em>a</em> (anchor tag).</p>
<p>Now that CSS 3 has come, why bother with old browser anymore? <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2010/06/pure-css-dropdown-with-a-little-css-3-juice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Chinese New Year and Valentine Day!</title>
		<link>http://jeffri.net/2010/02/happy-chinese-new-year-and-valentine-day/</link>
		<comments>http://jeffri.net/2010/02/happy-chinese-new-year-and-valentine-day/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 02:27:31 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[drawing]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=444</guid>
		<description><![CDATA[For every one who celebrated: Happy Chinese New Year, Gong Xi Fa Cai And for couple: Happy Valentine Days You can also see this art and comment it on my Deviant Art account.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jeffri-h.deviantart.com/art/Sylviss-Sofian-Chinese-New-Yea-154015723" target="_blank"><img src="http://i212.photobucket.com/albums/cc274/keaglez/gongxi_valentine.jpg" width="540" border="0" alt="Happy Chinese New Year and Valentine Day"/></a></p>
<p>For every one who celebrated: Happy Chinese New Year, Gong Xi Fa Cai</p>
<p>And for couple: Happy Valentine Days</p>
<p>You can also see this art and comment it on <a href="http://jeffri-h.deviantart.com/art/Sylviss-Sofian-Chinese-New-Yea-154015723">my Deviant Art account</a>. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2010/02/happy-chinese-new-year-and-valentine-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another new templates</title>
		<link>http://jeffri.net/2009/01/another-new-templates/</link>
		<comments>http://jeffri.net/2009/01/another-new-templates/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 12:07:29 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=179</guid>
		<description><![CDATA[Since this blog launched, I have changed this blog templates three times. So, this is my third WordPress template. The first one, is called as Modern Capsule, that focusing on black, white and red colors. The second one is a simple template, called as Simple Golden Black, which used black and gold as its base [...]]]></description>
			<content:encoded><![CDATA[<p>Since this blog launched, I have changed this blog templates three times. So, this is my third WordPress template. The first one, is called as Modern Capsule, that focusing on black, white and red colors. The second one is a simple template, called as Simple Golden Black, which used black and gold as its base color. Now the third one, its a &#8216;whole&#8217; semi transparent template, that I called as Cross Line. Yup, almost all element is semi transparent. And the interesting one is, it changed the background color based on the current time (GMT +7), from morning to night. lol  <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Is it better?</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2009/01/another-new-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create WordPress template part 2</title>
		<link>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-2/</link>
		<comments>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-2/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 07:42:10 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=116</guid>
		<description><![CDATA[Now is the part 2. If you haven&#8217;t read the part 1 yet, go here to read it. If in the part 1 we have make the graphics we need to build the template, now it is the time to play with CSS and HTML. But first, before we going further, we must first understand [...]]]></description>
			<content:encoded><![CDATA[<p>Now is the part 2. If you haven&#8217;t read the part 1 yet, <a href="http://jeffri.net/2008/12/how-to-create-wordpress-template-part-1/" target="_self">go here</a> to read it. If in the part 1 we have make the graphics we need to build the template, now it is the time to play with CSS and HTML. But first, before we going further, we must first understand the <a href="http://codex.wordpress.org/Template_Hierarchy" target="_blank">WordPress template hirearchy</a>. The WordPress template, in the very minimum, need at least two files, <em>style.css</em> and <em>index.php</em>. We can however have more files that recognized by WordPress to deliver different look on different requested page. But now, we create the standar template, at least we have <em>header.php</em>, <em>footer.php</em>, <em>sidebar.php</em>, <em>index.php</em>, <em>comments.php</em>, <em>functions.php</em> and <em>style.css</em>.</p>
<p><span id="more-116"></span></p>
<p>We first start with <em>style.css</em>. The first thing we did is write the details of the template, on the comment header of <em>style.css</em>. <a href="http://codex.wordpress.org/Theme_Development#Theme_Style_Sheet">See here</a> for more information.</p>
<p>Here is my <em>style.css</em> details.</p>
<blockquote><p>/*<br />
Theme Name: Simple Golden Black<br />
Theme URI: http://wordpress.org<br />
Description: A simple template with elegant look.<br />
Author: Jeffri Hong<br />
Author URI: http://jeffri.net<br />
Version: 1.0<br />
Tags: two columns, fixed width, elegant, simple<br />
*/</p></blockquote>
<p>This is pretty self explanatory, isn&#8217;t it? <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This details will show in the themes selector on your WordPress admin page. Now let&#8217;s give some default properties.</p>
<blockquote><p>body<br />
{<br />
font-family: arial;<br />
font-size: 12px;<br />
margin: 0;<br />
padding: 0;<br />
background: #c6bb93;<br />
color: #310;<br />
}</p>
<p>div<br />
{<br />
margin: 0;<br />
padding: 0;<br />
}</p>
<p>a<br />
{<br />
text-decoration: none;<br />
color: #430;<br />
}</p>
<p>a:hover<br />
{<br />
text-decoration: underline;<br />
color: #650;<br />
}</p>
<p>h1, h2, h3, h4, h5, h6<br />
{<br />
margin: 0;<br />
padding: 0;<br />
}</p></blockquote>
<p>Here we just give some properties on <em>body</em> and make sure that all <em>div</em> and <em>header</em> (<em>h1, h2, &#8230;</em>) have 0 <em>margin</em> and <em>padding</em>. We also give some properties for <em>anchor</em> (link) for normal one and hover one. That&#8217;s it.</p>
<p>Okay, let&#8217;s leave the <em>style.css</em> for a moment and move to <em>header.php</em>. Here is the <em>header.php</em>.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</p>
<p>&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;</p>
<p>&lt;head&gt;<br />
&lt;title&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php wp_title(); ?&gt;&lt;/title&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=&lt;?php bloginfo(&#8216;charset&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;meta name=&#8221;generator&#8221; content=&#8221;WordPress &lt;?php bloginfo(&#8216;version&#8217;); ?&gt;&#8221; /&gt; &lt;!&#8211; leave this for stats please &#8211;&gt;<br />
&lt;style type=&#8221;text/css&#8221; media=&#8221;screen&#8221;&gt;<br />
@import url( &lt;?php bloginfo(&#8216;stylesheet_url&#8217;); ?&gt; );<br />
&lt;/style&gt;<br />
&lt;link rel=&#8221;alternate&#8221; type=&#8221;application/rss+xml&#8221; title=&#8221;RSS 2.0&#8243; href=&#8221;&lt;?php bloginfo(&#8216;rss2_url&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;link rel=&#8221;alternate&#8221; type=&#8221;text/xml&#8221; title=&#8221;RSS .92&#8243; href=&#8221;&lt;?php bloginfo(&#8216;rss_url&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;link rel=&#8221;alternate&#8221; type=&#8221;application/atom+xml&#8221; title=&#8221;Atom 0.3&#8243; href=&#8221;&lt;?php bloginfo(&#8216;atom_url&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;link rel=&#8221;pingback&#8221; href=&#8221;&lt;?php bloginfo(&#8216;pingback_url&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;?php wp_get_archives(&#8216;type=monthly&amp;format=link&#8217;); ?&gt;<br />
&lt;?php wp_head(); ?&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;div id=&#8221;header&#8221;&gt;<br />
&lt;div id=&#8221;header-content&#8221;&gt;<br />
&lt;h1&gt;&lt;a href=&#8221;&lt;?php bloginfo(&#8216;url&#8217;); ?&gt;&#8221;&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;h4&gt;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&lt;/h4&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;header-menu&#8221;&gt;<br />
&lt;ul id=&#8221;head-menu-list&#8221;&gt;<br />
&lt;?php wp_list_pages(&#8216;title_li=&#8217;); ?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The <em>head</em> tag is actually copied from other WordPress template, we don&#8217;t need to care about it for now. The interesting part is in the <em>body</em> tag. You can see that I use <em>div</em> tag instead of classic table for layout. The <em>header-content</em> will contain the blog title and description while the <em>header-menu</em> contain the pages list. This won&#8217;t reproduce the output we want yet, it still need an assist from CSS. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Also, you can see that we call some WordPress function here. The <a href="http://codex.wordpress.org/Bloginfo" target="_blank">bloginfo</a> and <a href="http://codex.wordpress.org/wp_list_pages" target="_blank">wp_list_pages</a>, see the links for more information. The body tag didn&#8217;t closed here, it will be closed on <em>footer.php</em>.</p>
<p>So now, let&#8217;s get going to the <em>footer.php</em>. It will contain this.</p>
<blockquote><p>&lt;div id=&#8221;footer&#8221;&gt;<br />
&lt;div id=&#8221;footer-content&#8221;&gt;<br />
&lt;h4&gt;&amp;copy; Copyright &lt;?php echo date(&#8220;Y&#8221;); ?&gt; &lt;?php bloginfo(&#8216;name&#8217;); ?&gt;. Powered by &lt;a href=&#8221;http://wordpress.org/&#8221;&gt;WordPress&lt;/a&gt; and template by &lt;a href=&#8221;http://jeffri.net&#8221;&gt;Jeffri&lt;/a&gt;.&lt;/h4&gt;<br />
&lt;/div&gt;<br />
&lt;img src=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;); ?&gt;/images/foot-right.png&#8221; alt=&#8221;foot right bg&#8221; style=&#8221;float: left;&#8221; /&gt;<br />
&lt;/div&gt;<br />
&lt;?php wp_footer(); ?&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>It is still nothing new here. Just another layout for footer with <em>div</em>. On the <em>footer-content</em> we will have copyright information. Notice there is <em>img</em> tag there. It is used as delimiter between the <em>footer-content</em> which have bright background and the <em>footer</em> dark background. This <em>img</em> tag is floating left as you can see.</p>
<p>Header and footer are ready now, next, we going to <em>index.php</em>.</p>
<blockquote><p>&lt;?php<br />
get_header();<br />
?&gt;</p>
<p>&lt;div id=&#8221;center&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;?php<br />
get_footer();<br />
?&gt;</p></blockquote>
<p>OK, leave it like this first. You see we call <em>get_header</em> and <em>get_footer</em> function, this is the same as include the <em>header.php</em> and <em>footer.php</em>. We also have one <em>div</em> here. It will used later. Now, it is the time to play with the CSS and doing the positioning for header and footer.</p>
<p>We start from header.</p>
<blockquote><p>h1<br />
{<br />
font-size: 50px;<br />
line-height: 70px;<br />
}</p>
<p>#header<br />
{<br />
background: #000 url(images/head-bg.png) repeat-x;<br />
width: 100%;<br />
height: 150px;<br />
overflow: hidden;<br />
}</p>
<p>#header-content<br />
{<br />
margin: 7px 2%;<br />
}</p>
<p>#header-content h1 a<br />
{<br />
color: #ddd;<br />
}</p>
<p>#header-content h1 a:hover<br />
{<br />
color: #aaa;<br />
text-decoration: none;<br />
}</p>
<p>#header-content h4<br />
{<br />
color: #cb9;<br />
font-size: 14px;<br />
line-height: 14px;<br />
}</p>
<p>#header-menu<br />
{<br />
float: right;<br />
background: url(images/head-menu-side.png) no-repeat top left;<br />
padding: 0 0 0 51px;<br />
margin: 8px 2%;<br />
}</p>
<p>#head-menu-list<br />
{<br />
padding: 0;<br />
margin: 0;<br />
}</p>
<p>#head-menu-list li<br />
{<br />
list-style-type: none;<br />
float: left;<br />
padding: 0 25px 0 10px;<br />
background: url(images/head-menu-bg.png) repeat-x;<br />
height: 35px;<br />
line-height: 35px;<br />
}</p>
<p>#head-menu-list li a<br />
{<br />
color: #000;<br />
font-size: 21px;<br />
font-weight: bold;<br />
}</p></blockquote>
<p>Okay, a little explanation about this. If you see the header.php html, we have one parent <em>div</em> (header) with another two <em>div</em> (header-content and header-menu). The <em>header-content</em> will be placed on top left. But the <em>header-menu</em> will be placed on bottom right. We start with the parent <em>div</em>, we give black background with black background image (see the <a href="http://jeffri.net/2008/12/how-to-create-wordpress-template-part-1/" target="_self">previous part</a> to know what images we refer to here), and it is repeated horizontally. The width is 100% so this <em>div</em> will fill all of available width of your browser. The height is 150px, same as the background image height.</p>
<p>The <em>header-content</em> have <em>margin</em> of 7px on top and bottom, and 2% for left and right. Along with <em>h1</em> (the blog title with <em>line-height</em> 70px) and <em>h4</em> (the blog description with <em>line-height</em> 14px), so far we have filled 98px for the <em>header-content</em>. So the rest 52px (150 &#8211; 98) will be used for <em>header-menu</em>. This way, we calculate the remaining height to positioning <em>header-menu</em> to bottom. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It is probably not the best way, but it is also not a bad way, because our target now is Internet Explorer 6 or higher. I don&#8217;t want to care of another crappy old browser. <img src='http://jeffri.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Now we positioning the <em>header-menu</em>. We first <em>float</em> it to right, then choose the best <em>margin</em> for it. For the background, we use the delimiter image with no repeat, and to show the image, we add the left padding to 52px. We didn&#8217;t use different <em>img</em> tag for this as we do on footer, because we have the space for this image already. lol <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Okay, the next is to positioning the list to horizontal. It is a bit tricky.</p>
<p>Before that, we give 0 <em>padding</em> and <em>margin</em> to the <em>ul</em> (head-menu-list) first. Then to the <em>li</em>, we give <em>float</em> left, this way, it will be listing horizontally. We also give some <em>padding</em> there (left and right only), and use the light background. For height, we make it same as <em>line-height</em> to make it center vertically. That&#8217;s it. Header done, it will now looks like below.</p>
<p><img class="alignnone" style="width: 550px;" title="the header" src="http://i212.photobucket.com/albums/cc274/keaglez/the-header.jpg" alt="" /></p>
<p>Now, the footer. Here we go.</p>
<blockquote><p>#footer<br />
{<br />
background: #000 url(images/foot-base-bg.png) repeat-x;<br />
width: 100%;<br />
height: 45px;<br />
clear: both;<br />
}</p>
<p>#footer-content<br />
{<br />
background: url(images/foot-bg.png);<br />
height: 45px;<br />
width: 70%;<br />
float: left;<br />
margin-left: 2%;<br />
padding: 0 20px;<br />
}</p>
<p>#footer-content h4<br />
{<br />
font-size: 12px;<br />
line-height: 45px;<br />
}</p></blockquote>
<p>Hmm&#8230;. The <em>footer</em> here is the parent <em>div</em> of <em>footer-content</em>, and we give it 100% width, same as <em>header</em> you see above. The height is 45px, same as the background image height. The background is the dark one, while the <em>footer-content</em> will have bright background. We also give <em>clear: both</em> to make sure it clear all floating element.</p>
<p>The <em>footer-content</em> is floating left, same as the image delimiter you see on the HTML. The height is also 45px, width on 70% also some margin and padding to make sure it shows fine. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For the h4, I only change the font size and line height to make sure it centered vertically. Now it should looks like this.</p>
<p><img class="alignnone" style="width: 550px;" title="the footer" src="http://i212.photobucket.com/albums/cc274/keaglez/the-footer.jpg" alt="" /></p>
<p>Not bad. That is enough today. Next day, we will start creating the sidebar and the content. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  See ya!</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create WordPress template part 1</title>
		<link>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-1/</link>
		<comments>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-1/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 08:42:45 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=106</guid>
		<description><![CDATA[Do you want to create your own WordPress template? It is not hard actually if you have enough knowledge of XHTML (or HTML) and CSS, and a little basic of PHP. This guide will split into multiple part as it is quite long. This is my way of creating WordPress template, so it might different [...]]]></description>
			<content:encoded><![CDATA[<p>Do you want to create your own WordPress template? It is not hard actually if you have enough knowledge of XHTML (or HTML) and CSS, and a little basic of PHP. This guide will split into multiple part as it is quite long. This is my way of creating WordPress template, so it might different than you. The first part is for preparation and designing, I haven&#8217;t touch the coding part yet, it will be on second part. I will make it with example and this example will be available to download for everyone later. Hehe&#8230; <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First is the preparation. For me, I will take a paper and a pen and start thinking of how the template will look like. Hmm&#8230; As of now, I will create a simple templates like usual blog template. One header with logo and description on top, one sidebar on left side, the content is on the center (right side from the sidebar), and one footer on bottom. That&#8217;s it. Okay, once you are ready then, let&#8217;s open your favorite graphics editor. For me, it is <a href="http://www.gimp.org/" target="_blank">GIMP</a>.</p>
<p><span id="more-106"></span></p>
<p>Now, create a new images. Since most users use the 1024 width screen, I create 1000 x 800 images. And now we will start creating the raw design. Here we go&#8230;</p>
<p>We create one layer for each header, sidebar, content and footer first. as you can see here.</p>
<p><img src="http://i212.photobucket.com/albums/cc274/keaglez/web-sketch1.jpg" alt="sketch 1" /></p>
<p>Hmm&#8230; All is in black&#8230; No matter, I want to use black and some gold like color as the base color. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Then, let&#8217;s start playing with a little advance tools from GIMP to make the graphics better. Here it is:</p>
<p><img src="http://i212.photobucket.com/albums/cc274/keaglez/web-sketch2.jpg" alt="sketch 2" /></p>
<p>Okay, that&#8217;s it. That is the result I want. As you can see, the header have a space (colored with gold one) for menu. I will use this for listing static pages. It is the same as my current template, you can see my static pages is listed in the top menu. Also, in this <em>raw</em> images, all element is still not placed properly, but that doesn&#8217;t matter. We just need a small portion from that images.</p>
<p>Now, let&#8217;s divide some images that looks same. We will later use CSS to repeat it. Here we go&#8230;</p>
<p><img src="http://i212.photobucket.com/albums/cc274/keaglez/web-sketch-list-images.jpg" alt="list images" /></p>
<p>See, we just need 13 images there that can represent this look. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  That is enough for today. Tomorrow I will start write the HTML and CSS code.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2008/12/how-to-create-wordpress-template-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A little guide of using jQuery</title>
		<link>http://jeffri.net/2008/12/a-little-guide-of-using-jquery/</link>
		<comments>http://jeffri.net/2008/12/a-little-guide-of-using-jquery/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 10:48:44 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=68</guid>
		<description><![CDATA[JQuery is Javascript library that can help you write code smaller and easier to take a good care of event handling, animating, AJAX and more. With jQuery, we can make our webpages more beautiful. You can see that I used it for my side menu here. This article didn&#8217;t intend to teach you how to [...]]]></description>
			<content:encoded><![CDATA[<p>JQuery is Javascript library that can help you write code smaller and  easier to take a good care of event handling, animating, AJAX and more. With jQuery, we can make our webpages more beautiful. You can see that I used it for my side menu here. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This article didn&#8217;t intend to teach you how to became the jQuery master and I&#8217;m far away from a master. It just for the case you didn&#8217;t know about jQuery yet and want to start with it, then this will be a good guide for you. If you want a more complete tutorial, go to the <a href="http://docs.jquery.com/Tutorials" target="_blank">jQuery documentation</a>.</p>
<p><span id="more-68"></span></p>
<p>To use jQuery, you must first download it on jQuery website, then load the jQuery js files on your HTML document. For example</p>
<blockquote><p>&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;<br />
    &lt;script type=&#8221;text/javascript&#8221;&gt;<br />
        // your code here<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;!&#8211; your html content &#8211;&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Now, you can start writing your Javascript code using the jQuery API. Also, you can also separate your Javascript code and load it.</p>
<p>Here is a little example use hover event and then show some box below it, also use the click event to show some alert.</p>

<script type="text/javascript">
$(document).ready(function(){
	$("#example-links").hover(function(){
		$("#example-box").show(500);
	}, function(){
		$("#example-box").hide(500);
	});
	$("#example-links").click(function(){
		alert("You clicked the example links!");
	});
});
</script>

<blockquote><p><a id="example-links" style="font-size: 20px;" href="#">Example</a></p>
<div id="example-box" style="margin: auto; background: #ff9999 none repeat scroll 0% 0%; display: none; width: 200px; height: 200px;">This is an example box.</div>
</blockquote>
<p>See&#8230; Quite cool eh? I use this on my side menu. So how to make this kind of code? It&#8217;s pretty easy using jQuery.</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(document).ready(function(){<br />
    $(&#8220;#example-links&#8221;).hover(function(){<br />
        $(&#8220;#example-box&#8221;).show(500);<br />
    }, function(){<br />
        $(&#8220;#example-box&#8221;).hide(500);<br />
    });<br />
    $(&#8220;#example-links&#8221;).click(function(){<br />
        alert(&#8220;You clicked the example links!&#8221;);<br />
    });<br />
});<br />
&lt;/script&gt;</p></blockquote>
<p>Look, that is the Javascript. Complicated? No, read carefully&#8230; First, we need to place all of our script on <em>$(document).ready()</em> event. So, this will set all of your event handler once the DOM (Document Object Model) is ready. You can have as many <em>$(document).ready()</em> event as you want in your header or body tags.</p>
<p>This event, need a callback function. Here we made the callback function directly on the <em>ready</em> event argument, without separated function. So the code is mostly like this</p>
<blockquote><p>$(document).ready(<br />
    function(){<br />
        // your code here<br />
    }<br />
);</p></blockquote>
<p>Ok, this make it clearer right? This is the basic of jQuery, most event are called like this.</p>
<p>Next, the selector, as you can see in this code, we have at least two unique selector, <em>#example-links</em> and <em>#example-box</em>. If you has known CSS, it is probably very clear to you. This select element that based on its id attribute. Then, enclose it with <em>$(</em> and <em>)</em> will construct the jQuery object. Oh, don&#8217;t forget to enclose the selector with quotes.</p>
<blockquote><p>$(&#8220;#example-links&#8221;).click(function(){<br />
    alert(&#8220;You clicked the example links!&#8221;);<br />
});</p></blockquote>
<p>This line set the click event handler for element with <em>example-links</em> id. So, while users click on this links, the alert box will be prompted.</p>
<blockquote><p>$(&#8220;#example-links&#8221;).hover(function(){<br />
    $(&#8220;#example-box&#8221;).show(500);<br />
}, function(){<br />
    $(&#8220;#example-box&#8221;).hide(500);<br />
});</p></blockquote>
<p>Now look on this line, it set the hover event handler. You can see that we have two function as the argument. The first one will be called when users hover the mouse on the element, while the second one will be called when the mouse out from the element. Inside the function, we call the show and hide effect for <em>#example-box</em> element. For more information about the events, effects, and more, see the <a href="http://docs.jquery.com/Main_Page" target="_blank">documentation page</a>.</p>
<p>I think the code is quite understandable now, if you at least have basic on Javascript before. Now the HTML</p>
<blockquote><p>&lt;a id=&#8221;example-links&#8221; style=&#8221;font-size: 20px;&#8221; href=&#8221;#&#8221;&gt;Example&lt;/a&gt;<br />
&lt;div id=&#8221;example-box&#8221; style=&#8221;margin: auto; background: #ff9999 none repeat scroll 0% 0%; display: none; width: 200px; height: 200px;&#8221;&gt;This is an example box.&lt;/div&gt;</p></blockquote>
<p>That&#8217;s all. Hope you find it useful. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2008/12/a-little-guide-of-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing IE bugs and using Jquery</title>
		<link>http://jeffri.net/2008/12/fixing-ie-bugs-and-using-jquery/</link>
		<comments>http://jeffri.net/2008/12/fixing-ie-bugs-and-using-jquery/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 09:21:09 +0000</pubDate>
		<dc:creator>keaglez</dc:creator>
				<category><![CDATA[Designing]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://jeffri.net/?p=60</guid>
		<description><![CDATA[Now, the templates is better, as I use Jquery, I can get the actual window size on Internet Explorer 7+. Also with a little enhancement with Jquery, you can see the animation while showing or hiding the side menu. Also I update the graphics to a little smaller so you can see the content wider. [...]]]></description>
			<content:encoded><![CDATA[<p>Now, the templates is better, as I use Jquery, I can get the actual window size on Internet Explorer 7+. Also with a little enhancement with Jquery, you can see the animation while showing or hiding the side menu. Also I update the graphics to a little smaller so you can see the content wider.</p>
<p>It still use fixed width, I will solve this later so if you are using wider screen, the head logo and menu will not separated from the main element. <img src='http://jeffri.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m still testing this templates and will improve it day by day. Damn, I think I really interested on creating WordPress templates now. Maybe I will make a public templates soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffri.net/2008/12/fixing-ie-bugs-and-using-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

