<?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>Fearless Flyer Web Design &#187; CSS</title>
	<atom:link href="http://fearlessflyer.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://fearlessflyer.com</link>
	<description>Fearless flyer is a blog that focuses on the latest topics of web design. This includes Wordpress, SEO, Photoshop, jQuery, PHP and CSS. Fearless flyer is owned and operated by Michael Soriano, a seasoned web developer living in Southern California.</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:11:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Create Super Easy jQuery Tabbed Containers</title>
		<link>http://fearlessflyer.com/2012/01/how-to-create-super-easy-jquery-tabbed-containers/</link>
		<comments>http://fearlessflyer.com/2012/01/how-to-create-super-easy-jquery-tabbed-containers/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 18:29:12 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tabs]]></category>
		<category><![CDATA[walkthrough]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=2324</guid>
		<description><![CDATA[In this tutorial I&#8217;m going to show you how to create tabbed containers using jQuery. Tabbed containers is an excellent way of presenting your content. Data is organized where only the current tab&#8217;s section is shown. Once the user clicks on the other tabs, its associated content gracefully appears. View Demo Please note that you ]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;m going to show you how to create tabbed containers using jQuery. Tabbed containers is an excellent way of presenting your content. Data is organized where only the current tab&#8217;s section is shown. Once the user clicks on the other tabs, its associated content gracefully appears. </p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/jquery_tabs/">View Demo</a></div>
<p>Please note that you will need to know some HTML / CSS and a little Javascript scripting to follow. Ready to get started? Let&#8217;s begin: </p>
<h3>Set up the HTML:</h3>
<p>First and foremost &#8211; we need the markup. We need this so we know what we are styling and manipulating. We are going to use semantic and valid HTML. In addition, we will keep it as clean as possible &#8211; with no unnecessary DIVs and classes in our code:</p>

<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
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul id=&quot;tabs&quot;&gt;
      &lt;li&gt;&lt;a href=&quot;#tab1&quot;&gt;Files and Folders&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tab2&quot;&gt;User Profiles&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tab3&quot;&gt;Contacts&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tab4&quot;&gt;Applications&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tab5&quot;&gt;Monthly Cost&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;div class=&quot;container&quot; id=&quot;tab1&quot;&gt;
    ...content goes here
&lt;/div&gt;
&lt;div class=&quot;container&quot; id=&quot;tab2&quot;&gt;
    ...content goes here
&lt;/div&gt;
&lt;div class=&quot;container&quot; id=&quot;tab3&quot;&gt;
    ...content goes here
&lt;/div&gt;
&lt;div class=&quot;container&quot; id=&quot;tab4&quot;&gt;
    ...content goes here
&lt;/div&gt;
&lt;div class=&quot;container&quot; id=&quot;tab5&quot;&gt;
    ...content goes here
&lt;/div&gt;</pre></td></tr></table></div>

<p>As you can see, our markup is pretty self-explanatory. The UL items will be our tabs, while the DIVs below it are the containers. Save your file and view it in the browser: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2011/12/tutorial1.jpg" alt="tutorial1 How to Create Super Easy jQuery Tabbed Containers" title="tutorial1" width="446" height="399" class="alignnone size-full wp-image-2325" /></p>
<h3>Add Some Sweet Styles:</h3>
<p>I usually like to style the HTML right after. This way &#8211; I can write the script exactly how to behave. Moreover, we can decide if what classes to add via Javascript. </p>
<h6>The Tabs</h6>
<p>Let&#8217;s convert our unordered list into tabs:</p>

<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="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tabs</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">28px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eff5f9</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">inset</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span><span style="color: #993333;">inset</span>  <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">inset</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
	border-top-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>  
	border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#tabs</span> li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> 
	border-top-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>  
	border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#dadada</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#tabs</span> li a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Arial</span><span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span> <span style="color: #933;">14px</span> <span style="color: #933;">6px</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>  
	border-top-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> 
	border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#ebebeb</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">white</span> <span style="color: #933;">10%</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10%</span><span style="color: #00AA00;">,</span> from<span style="color: #00AA00;">&#40;</span><span style="color: #cc00cc;">#ebebeb</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> to<span style="color: #00AA00;">&#40;</span><span style="color: #993333;">white</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span><span style="color: #933;">-1px</span> <span style="color: #933;">-1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Save your file and view it in the browser: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2011/12/tutorial2.jpg" alt="tutorial2 How to Create Super Easy jQuery Tabbed Containers" title="tutorial2" width="500" height="284" class="alignnone size-full wp-image-2327" /></p>
<p>Beautiful right? Things are coming along. We also want to add a style for the &#8220;inactive&#8221; state of the tabs. This will be how the tabs will look when they&#8217;re not in focus. Add the code below to your stylesheet:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tabs</span> li a.inactive<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#dedede</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">white</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">,</span> from<span style="color: #00AA00;">&#40;</span><span style="color: #cc00cc;">#dedede</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> to<span style="color: #00AA00;">&#40;</span><span style="color: #993333;">white</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#tabs</span> li a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#tabs</span> li a<span style="color: #6666ff;">.inactive</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#dedede</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Notice that I also added a separate style for <em>:hover</em>. To see how these styles look, you have to manually add class &#8220;inactive&#8221; to the anchor tags in our tabs, and refresh your browser: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2011/12/tutorial3.jpg" alt="tutorial3 How to Create Super Easy jQuery Tabbed Containers" title="tutorial3" width="439" height="236" class="alignnone work size-full wp-image-2328" /></p>
<h6>The Containers</h6>
<p>The containers styles really depend on you. I just added some general rules such as width and appropriate paddings:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span><span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> 	 	 
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">664px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> 	 
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Now we have a solid look and we can continue with the scripting. Be sure to add some dummy content to your containers before we go on. </p>
<h3>The jQuery</h3>
<p>This part may have the shortest code, but will do a lot of work. Lets include the jQuery library into our page and start our document ready event. Append this code into your HTML:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.1/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<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; 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: #006600; font-style: italic;">//our script goes here...</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Now we need a way make our tabs inactive and hide the containers. Add the lines of code inside our document ready block:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tabs li a:not(:first)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.container:not(:first)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The code above adds the class &#8220;inactive&#8221; to all our our tabs &#8211; except the first one using the &#8220;:not(:first)&#8221; filter. The second line hides all of our container divs &#8211; except the first one, again using the said filter.<br />
Refresh your browser and you shall see the effects: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2011/12/tutorial4.jpg" alt="tutorial4 How to Create Super Easy jQuery Tabbed Containers" title="tutorial4" width="500" height="428" class="alignnone size-full wp-image-2330" /></p>
<p>Now let&#8217;s add a click handler to our tabs along with the events. Add the lines of code also inside document ready:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tabs li a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; 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: #003366; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tabs li a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>A lot of things are happening here &#8211; first &#8211; we&#8217;ve established a click handler to our tabs. We also created a variable &#8220;t&#8221; that represents the value of the &#8220;href&#8221; attribute for whichever anchor tag that was clicked. For instance, if the first tab was clicked, then &#8220;t&#8221; will be &#8220;#tab1&#8243;. Then we add class &#8220;inactive&#8221; to all of the tabs, while removing &#8220;inactive&#8221; to whichever one was clicked. Then, we hide all of the containers while fading in the one that is &#8220;t&#8221;, i.e. #tab1 or #tab2 and so on. Return false just prevents the anchor links from their default behavior.</p>
<p>Refresh your browser and try it out. So our tabs are in full action. There is one problem though: when you click the current tab &#8211; it still attempts to hide all the containers and show the current one &#8211; we don&#8217;t want this to happen. Let&#8217;s add a conditional block to our code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//this is the start of our condition </span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tabs li a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		 
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'inactive'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Wrapping our events inside this if block prevents this unwanted behavior. </p>
<h3>Conclusion</h3>
<p>And there you have it. Wasn&#8217;t that easy? Super Easy? The best thing about this code is it doesn&#8217;t use any images. All of the gradients and shadows are CSS3. Also, it is backwards compatible for users without Javascript. It won&#8217;t work as tabs &#8211; but it will show the full content, and the tabs will still lead them to the right area when clicked. </p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2012/01/how-to-create-super-easy-jquery-tabbed-containers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Create Rotating (Full Paged) Background Images with CSS and jQuery</title>
		<link>http://fearlessflyer.com/2011/10/create-rotating-full-paged-background-images-with-css-and-jquery/</link>
		<comments>http://fearlessflyer.com/2011/10/create-rotating-full-paged-background-images-with-css-and-jquery/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 14:30:56 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[fade effect]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[large backgrounds]]></category>
		<category><![CDATA[rotating image]]></category>
		<category><![CDATA[slideshow background]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=2207</guid>
		<description><![CDATA[Full page background images on web sites has become more popular than ever. Its a good way to utilize the remaining real estate of the browser, without having to sacrifice content. But what about rotating these images? Wouldn&#8217;t that even be better? This tutorial will walk you through how to create full page background images ]]></description>
			<content:encoded><![CDATA[<p>Full page background images on web sites has become more popular than ever. Its a good way to utilize the remaining real estate of the browser, without having to sacrifice content. But what about rotating these images? Wouldn&#8217;t that even be better? </p>
<p>This tutorial will walk you through how to create full page background images that rotate like a slideshow. We will be using CSS and jQuery &#8211; particularly the nifty <a href="http://jquery.malsup.com/cycle/">cycle plugin</a>. Ready to get started? Let&#8217;s begin:</p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/rotating-bg/">View the Demo</a></div>
<h3>The HTML Markup:</h3>
<p>First we create the background images. Place them in your root folder, in a directory called &#8220;images&#8221;. We wrap them around a special DIV which houses all the images. We need this DIV so we can target it from our script later:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;slideshow&quot;&gt;
&lt;img src=&quot;/images/b1.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b2.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b3.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b4.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b5.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b6.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;img src=&quot;/images/b7.jpg&quot; class=&quot;bgM&quot;/&gt;
&lt;/div&gt;
&lt;div id=&quot;wrap&quot;&gt;
...your content here
&lt;/div&gt;</pre></td></tr></table></div>

<p>Make sure your image is a good sized horizontal shot. For almost all screen resolutions have wider width vs height. Our images will scale to the width of the screen. The DIV id=&#8221;wrap&#8221; is the container for your content. This is directly underneath our slideshow container. Save your HTML and view it in the browser. You should see a series of images on top of each other. </p>
<h3>The CSS</h3>
<p>Add this code to your page. This will set the images width to span the entire page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#slideshow</span><span style="color: #00AA00;">,</span> img<span style="color: #6666ff;">.bgM</span> <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">min-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1024px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span>-<span style="color: #cc66cc;">9999</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>View Refresh your page. You should see only the first image. The rest of the images are tucked away underneath the first one. This is what &#8220;z-index&#8221; and &#8220;position&#8221; properties in our code did. Now for the slideshow effect, we use some jQuery magic. </p>
<h3>The jQuery</h3>
<p>Download the jQuery Cycle plugin from <a href="http://jquery.malsup.com/cycle/download.html">here</a>, and place it inside a directory called &#8220;scripts&#8221; in your root folder. Add the jQuery library and a reference to the plugin inside the head section of your HTML:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.6.3.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery.cycle.all.2.74.js&quot;&gt;&lt;/script&gt;</pre></td></tr></table></div>

<p>Then add this code that will pickup our slideshow DIV, and apply the cycle functionality from our plugin:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; 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: #3366CC;">'#slideshow'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				fx<span style="color: #339933;">:</span> <span style="color: #3366CC;">'fade'</span><span style="color: #339933;">,</span>
				pager<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#smallnav'</span><span style="color: #339933;">,</span> 
				pause<span style="color: #339933;">:</span>   <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> 
				speed<span style="color: #339933;">:</span> <span style="color: #CC0000;">1800</span><span style="color: #339933;">,</span>
				timeout<span style="color: #339933;">:</span>  <span style="color: #CC0000;">3500</span> 
			<span style="color: #009900;">&#125;</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></pre></td></tr></table></div>

<p>You can choose to edit the plugin options by tweaking the above code. For the list of available options such as transition effects, timing and callbacks &#8211; refer to the jQuery Cycle <a href="http://jquery.malsup.com/cycle/options.html">docs</a>.</p>
<h3>Conclusion:</h3>
<p>Now refresh your browser and you should see your background fade into the next image and to another. Like I said, this style can be quite refreshing &#8211; to vary your page from a million other websites out there with large image backgrounds. The only problem with this is when browser is resized, the image stays in the original size and doesn&#8217;t resize on the fly. Maybe one of you guys can improve the image handling with javascript or something.</p>
<p><strong>Bonus Tip:</strong> for added functionality, you can add individual links to the background images by wrapping each image into an anchor tag:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;slideshow&quot;&gt;
&lt;a href=&quot;http://yahoo.com&quot;&gt;&lt;img src=&quot;images/b1.jpg&quot; &lt;/a&gt;
&lt;img src=&quot;images/b3.jpg&quot; class=&quot;bgM&quot;/&gt;
class=&quot;bgM&quot;/&gt;&lt;/a&gt;</pre></td></tr></table></div>

<p>This is especially useful if you&#8217;re using your background as advertising space of some sort (hint hint). </p>
<p>So go on and try it out for yourself. Please leave me a comment below if you have suggestions on how to improve the code, show off your stuff, or simply say hello. </p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/rotating-bg/">View the Demo</a></div>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2011/10/create-rotating-full-paged-background-images-with-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Yet Another jQuery Accordion Tutorial</title>
		<link>http://fearlessflyer.com/2010/11/yet-another-jquery-accordion-tutorial/</link>
		<comments>http://fearlessflyer.com/2010/11/yet-another-jquery-accordion-tutorial/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 19:22:15 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1905</guid>
		<description><![CDATA[It just about that time some good old fashioned web programming. Today we’re learning how to create an accordion style page – using my most favorite of tools: jQuery and CSS. We will try to accomplish an accordion that is so simple, yet useful enough for you to use in your existing pages. Ready to ]]></description>
			<content:encoded><![CDATA[<p>It just about that time some good old fashioned web programming. Today we’re learning how to create an accordion style page – using my most favorite of tools: jQuery and CSS. We will try to accomplish an accordion that is so simple, yet useful enough for you to use in your existing pages. Ready to get started – let’s begin.</p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/accordion/">View Demo</a></div>
<h3>The Goal:</h3>
<p>We will use clean markup. We’re trying to integrate this into exsting HTML – so we will be generating all extra classes and tags using Javascript.  I imagine most web documents follow the same constant pattern: Heading tags, followed by some content which are a mixture of different DIVS, paragraphs, images etc. This goes on until the next heading tag &#8211; which is usually the same type as the first heading. </p>
<p>Look at the sample mark up below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;h5&gt;Some Heading&lt;/h5&gt;
       &lt;!--content in here--&gt;
&lt;h5&gt;Some Heading&lt;/h5&gt;
       &lt;!--content in here--&gt;
&lt;h5&gt;Some Heading&lt;/h5&gt;
        &lt;!--content in here--&gt;</pre></td></tr></table></div>

<p>We will use the H5 tags as our “<strong>Clicker</strong>” – once clicked, will hide the contents right underneath it. Click it again, and it will show the contents again. </p>
<h3>The Script:</h3>
<p>We start by calling the jQuery library, followed by the document.ready() call:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.4.3.min.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
               <span style="color: #339933;">&lt;!--</span>script goes here<span style="color: #339933;">--&gt;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>We then loop through each of our particular heading tag (in this case, all of H5).  Once it finds all of them, it checks to see if right next to it is another H5 tag; if it’s not, it adds a class of “<strong>clicker</strong>” to it and appends a span with a minus (-) sign in it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h5&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>				
	    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;clicker&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span&gt;-&lt;/span&gt;'</span><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></pre></td></tr></table></div>

<p>If you investigate your code so far – you will see that only the H5 tags that have content OTHER than H5 tags have the class “<strong>clicker</strong>” and the span tag with a minus (-) sign in it: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/11/accordion1.jpg" alt="accordion1 Yet Another jQuery Accordion Tutorial" title="accordion1" width="576" height="298" class="alignnone size-full wp-image-1906" /></p>
<p>Now let’s code the click events:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h5.clicker&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; 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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextUntil</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h5&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'+'</span><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: #003366; 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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextUntil</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h5&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fast'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Now that we have our designated clickers, we create a couple of functions that toggle at every click. </p>
<p>The first action, hides the contents below &#8220;<strong>$(this)</strong>&#8221; – which is the tag you just clicked. Remember &#8211; we only want to hide the contents up until the next H5 tag. It also changes the content of the span into a plus (+) symbol.</p>
<p>The second action shows the contents below, and changes the span to a minus (-) symbol. </p>
<h3>Optional Styling:</h3>
<p>At this point you already have a functional accordion. If you’re applying the code to an existing page, you are already working with the current styles.  Although, using CSS3 for say the plus (+) and minus (-) span looks pretty cool – which I’m sure you’d want to use. </p>
<p>Add this code to your styles:</p>

<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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2daebf</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">alert-overlay.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">9px</span> <span style="color: #933;">2px</span> <span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> 
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #933;">3px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-1px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.25</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.25</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Arial</span><span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-47px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*ie 7*/</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#007d9a</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #3333ff;">:active</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#wrap</span> h5 span<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">23px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-1px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.25</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Of course you have to replace the #wrap h5 with your own class / ids. This creates the css3 button you see in the demo. This code is courtesy of <a href="http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba"> Zurb’s Super Awesome buttons with CSS3 and RGBA:</a>   </p>
<h3>Conclusion</h3>
<p>And that is it! You have yourself an accordion page powered by jQuery.  Feel free to grab this code and improve it. Maybe refactor it into a more plugin like code – make it more reusable. Or even &#8211; fix the choppiness issue in the slideUp / slideDown animation in certain browsers. In any case, please leave a comment on what you think of this code.</p>
<p>You might also be interested in these articles regarding jQuery accordions: </p>
<ul>
<li><a href="http://www.sohtanaka.com/web-design/simple-accordion-w-css-and-jquery/">Simple Accordion w/ CSS and jQuery</a></li>
<li><a href="http://net.tutsplus.com/tutorials/javascript-ajax/exactly-how-to-create-a-custom-jquery-accordion/">Exactly How to Create a Custom jQuery Accordion </a></li>
<li><a href="http://css-tricks.com/grid-accordion-with-jquery/">Grid Accordion with jQuery</a></li>
</ul>
<div class="special">There are no downloads for this tutorial because it&#8217;s pretty simple to follow. View the source code of the demo page to get the code</div>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/accordion/">View Demo</a></div>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/11/yet-another-jquery-accordion-tutorial/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to Create Your Own jQuery Content Slider</title>
		<link>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/</link>
		<comments>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 19:27:47 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Content Slider]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1762</guid>
		<description><![CDATA[This tutorial will show you how to create your own jQuery content slider. You may ask &#8220;Why create my own if there are hundreds of already made sliders out there?&#8221; This is true: I myself almost always use ready made plugins for my projects. Yet, it is always a good thing to know how they ]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to create your own jQuery content slider. You may ask &#8220;<em>Why create my own if there are hundreds of already made sliders out there?</em>&#8221; This is true: I myself almost <em>always</em> use ready made plugins for my projects. Yet, it is always a good thing to know how they work. It also comes in handy &#8211; if you should ever want to customize it (it’s always harder to edit someone else’s code). </p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/content-slider/">View the Demo</a></div>
<div class="special">If you choose to skip the tutorial &#8211; you are free to download the source code from this <a href="http://fearlessflyer.com/downloads/content-slider.zip">link</a></div>
<p>So are you ready to get started? Let’s begin: </p>
<h3>Step 1: Create the Base Mark Up</h3>
<p>What we need is a series of images in an unordered list:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;image1.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image2.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image3.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image4.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image6.jpg&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Pretty straightforward code – view it in the browser and see a bunch of images listed from top to bottom. </p>
<h3>Step 2: Add jQuery Code to hide unfocused images:</h3>
<p>What we’re trying to achieve is to only show the first image of the list and hide the rest. We do this by applying some CSS rules via jQuery to the mark up we&#8217;ve created. We also want to line up the hidden images to the right – so we can add controls that animate the entire ul a little bit to the left at a time (see illustration below):</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot1.jpg" alt="screenshot1 How to Create Your Own jQuery Content Slider" title="screenshot1" width="576" height="490" class="alignnone size-full wp-image-1763" style="border:none;" /></p>
<p>Add the following code right above the closing head tag:</p>

<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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/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<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; 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: #003366; font-weight: bold;">var</span> theImage <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul li img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> theWidth <span style="color: #339933;">=</span> theImage.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #006600; font-style: italic;">//wrap into mother div</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;mother&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
	<span style="color: #006600; font-style: italic;">//assign height width and overflow hidden to mother</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mother'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		width<span style="color: #339933;">:</span> <span style="color: #003366; 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: #000066; font-weight: bold;">return</span> theWidth<span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		height<span style="color: #339933;">:</span> <span style="color: #003366; 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: #000066; font-weight: bold;">return</span> theImage.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'relative'</span><span style="color: #339933;">,</span>
		overflow<span style="color: #339933;">:</span> <span style="color: #3366CC;">'hidden'</span>  	
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">//get total of image sizes and set as width for ul </span>
	<span style="color: #003366; font-weight: bold;">var</span> totalWidth <span style="color: #339933;">=</span> theImage.<span style="color: #660066;">length</span> <span style="color: #339933;">*</span> theWidth<span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		width<span style="color: #339933;">:</span> <span style="color: #003366; 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: #000066; font-weight: bold;">return</span> totalWidth<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>		
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//doc ready</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p><strong>In English</strong>: in the first script tag – we have connected to the jQuery library online. Then we go in the <strong>window.load()</strong> event *as supposed to document.ready() – because of an <a href="http://stackoverflow.com/questions/1126272/are-image-properties-part-of-the-dom-jquery-webkit-inconsistency-with-other-br">issue detecting image width and height with webkit browsers</a>. Then we set up a couple of variables which are all the images inside the unordered list, along with their widths. We wrap the unordered list (using the .wrap() function) inside a div called “mother” with the CSS rules I mentioned.</p>
<h3>Step 3: Add “Next” and “Previous” Buttons</h3>
<p>In our HTML – add anchor tags with the class “<em>next</em>” (If you want to move forward the slider) and “<em>previous</em>” (to go backward) inside the list items:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;image1.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image2.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image3.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image4.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image6.jpg&quot; /&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;a class=&quot;startover&quot; href=&quot;#&quot;&gt;startover&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Note that you will not see these links when you preview the page. This is because they are tucked away outside the visible region of the overflow property we’ve created: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot2.jpg" alt="screenshot2 How to Create Your Own jQuery Content Slider" title="screenshot2" width="576" height="396" class="alignnone size-full wp-image-1764" style="border:none;" /></p>
<h3>Step 3: The Nifty .Animate()Method</h3>
<p>Okay, now we’ve come to the part where we actually see some action. The whole point of what we’re trying to do is to move the list a little to the right – when the &#8220;<em>next</em>&#8221; link is clicked, and to the left if &#8220;<em>previous</em>&#8221; is clicked: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot3.jpg" alt="screenshot3 How to Create Your Own jQuery Content Slider" title="screenshot3" width="576" height="396" class="alignnone size-full wp-image-1765" style="border:none;" /></p>
<p>Add the following javascript code inside the existing script tags:</p>

<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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>theImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>		
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>intIndex<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>				
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; 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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.next&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>	<span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>intIndex <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> theWidth<span style="color: #009900;">&#41;</span>				
					<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span>	
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.previous&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>intIndex <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> theWidth<span style="color: #009900;">&#41;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span>	
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.startover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</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: #006600; font-style: italic;">//close .bind()									 </span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//close .each()</span></pre></td></tr></table></div>

<p><strong>Explanation:</strong> the code above starts out with the “<em>.each</em>” function – which is essentially a loop that looks for each of our images in the list. Then it finds all of the anchor tags next to the images (through <em>.nextAll</em>) and checks them for the assigned class. If the class says <em>“next”</em> – animate the parent (ul) to the left by applying a margin-left CSS property to it. The same thing goes for class<em> “previous”</em>. The only difference is the index is advanced vs. deducted multiplied by the image width. Lastly – is class “<em>startover</em>” which resets the slider to its original position. </p>
<p>Add the CSS code below inside the <em>“head”</em> tag so you can see the links and start testing them:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
<span style="color: #00AA00;">*</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ul li <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.startover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h3>
Step 4: Make ‘er Nice and Purrty</h3>
<p>Technically – our slider is done. This section mainly focuses on making it look nice and presentable. So I grab this file: <a href="http://fearlessflyer.com/u/slider-constructor">Slider Constructor from Graphic River</a>. Slider Constructor is a high quality Photoshop filled with shiny slider buttons and controls that will surely bring life to your new slider. Create the buttons of your choice from this file and save them as individual .pngs.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot4.jpg" alt="screenshot4 How to Create Your Own jQuery Content Slider" title="screenshot4" width="576" height="178" class="alignnone size-full wp-image-1766" style="border:none;" /></p>
<p>You can set a different button for each anchor tag in each slide. You can also place them anywhere you want with some CSS positioning. Either add an &#8220;id&#8221; attribute to the individual anchor tags, or an additional class (which is what I did). Below is the CSS for my demo &#8211; of course, you might want to code yours differently:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ul li a<span style="color: #6666ff;">.next</span>.<span style="color: #993333;">red</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-red.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">57px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">73px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">560px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">237px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span>.<span style="color: #993333;">green</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-green.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">286px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">486px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span>.<span style="color: #993333;">green</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-green.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">286px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">105px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span><span style="color: #6666ff;">.orange</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-orange.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">239px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">62px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">360px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #6666ff;">.orange</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-orange.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">239px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">62px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span>.<span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-blue.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">57px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">129px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">562px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span>.<span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-blue.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">58px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">129px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span>.<span style="color: #993333;">silver</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">previous-silver.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">49px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">305px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">360px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.startover</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">startover.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">176px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">73px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">280px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">420px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Also &#8211; the good thing about this code is you can place and style the buttons individually. </p>
<h3>Conclusion</h3>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/content-slider/">View the Demo</a></div>
<p>There, there – you’ve just done yourself some good coding <em>Sparky</em>!  Feel free to modify, re-factor and make the code better. This is as basic as it gets – so have fun tweaking it. Make sure you leave a comment or spread the word by retweeting or liking it in facebook. Until next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Tasty Trends in Themeforest Templates</title>
		<link>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/</link>
		<comments>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 02:39:07 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[premium theme]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[ThemeForest]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1546</guid>
		<description><![CDATA[One of my favorite ways to stay up to date on the latest design trends is to browse Themeforest. Themeforest has hundreds of the finest web and graphic designers trying to sell their work. It is no surprise that it is here that you will see new styles and craze to ever hit the world ]]></description>
			<content:encoded><![CDATA[<p>One of my favorite ways to stay up to date on the latest design trends is to browse Themeforest. Themeforest has hundreds of the finest web and graphic designers trying to sell their work. It is no surprise that it is here that you will see new styles and craze to ever hit the world of web design.  Below is a list of styles (along with some examples) that I have been noticing in new templates from Themeforest: </p>
<div class="special">Note &#8211; in case you&#8217;re wondering, yes &#8211; the links to the items below are affiliate links. But this doesn&#8217;t mean that I&#8217;m just trying to make a buck &#8211; these templates are truly awesome.</div>
<h3>Bokeh and Blurry Backgrounds</h3>
<p>I first saw this style from this popular <a href="http://fearlessflyer.tumblr.com/">Tumblr theme</a>. <strong>Bokeh</strong> is an effect where a colorful palette of round reflections are so washed and blurred from an out of focus lens of some sort. This mystique of photography somehow brings the subject (the content in our case) a much more focused and sharper look. The Bokeh effect gives the entire page an overall feeling of harmony and beauty. </p>
<h6><a href="http://fearlessflyer.com/u/blur">Blur</a></h6>
<p>Bokeh in combination with transparencies as well as rounded corners give this template a thumbs up from me!</p>
<p><a href="http://fearlessflyer.com/u/blur"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/blur.jpg" alt="blur Tasty Trends in Themeforest Templates" title="blur" width="576" height="323" class="alignnone size-full wp-image-1548" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/blur">You can view the Item here</a>, or <a href="http://enstyled.com/blur/index.html "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/modernbusiness">Modern Business 3</a></h6>
<p>This template uses bokeh in the inner frames of the page. Very sleek, professional and elegant.</p>
<p><a href="http://fearlessflyer.com/u/modernbusiness"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/modern-business.jpg" alt="modern business Tasty Trends in Themeforest Templates" title="modernbusiness" width="576" height="323" class="alignnone size-full wp-image-1557" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/modernbusiness">You can view the Item here</a>, or <a href="http://www.theaterwebsiteservices.com/themeforest/modern_business3_dark/index.html "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/darknclean">Dark ‘n Clean</a></h6>
<p>Another Bokeh Beauty, don&#8217;t miss the amazing typography from this theme!</p>
<p><a href="http://fearlessflyer.com/u/darknclean"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/dark-n-clean.jpg" alt="dark n clean Tasty Trends in Themeforest Templates" title="darknclean"  width="576" height="323" class="alignnone size-full wp-image-1550" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/darknclean">You can view the Item here</a>, or <a href="http://www.furtzdesigns.com/darknclean/ "target="_blank">Demo from Here</a></p>
<h3>Overlapping Folds</h3>
<p>This style has been around for a while, but still doesn&#8217;t fail to amaze me. It is when the designer takes page elements and wraps them among sections of the page, as if it was three dimensional.</p>
<h6><a href="http://fearlessflyer.com/u/unite">Unite</a></h6>
<p>Definitely one of my favorites. Exceptionaly detailed &#8211; the folds even change in orientation when scrolling up and down</p>
<p><a href="http://fearlessflyer.com/u/unite"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/unite.jpg" alt="unite Tasty Trends in Themeforest Templates" title="Make sure you check all the folds in this theme" width="576" height="356" class="alignnone size-full wp-image-1547 noborder showtip" style="border:none;" /><br />
</a><a href="http://fearlessflyer.com/u/unite">You can view the Item here</a>, or <a href="http://para.llel.us/themes/unite-wp/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/stage">Stage</a></h6>
<p>This one is very unorthodox. Folds, peels &#8211; 3d everywhere!</p>
<p><a href="http://fearlessflyer.com/u/stage"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/stage.jpg" alt="stage Tasty Trends in Themeforest Templates" title="so much depth in this template" width="576" height="405" class="showtip alignnone size-full wp-image-1561" style="border:none;" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/stage">You can view the Item here</a>, or <a href="http://idesi9n.com/stage/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/fancyfolio">Fancy Folio</a></h6>
<p>More in the safe and conservative style, checkout the folded navigation button</p>
<p><a href="http://fearlessflyer.com/u/fancyfolio"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/fancy-folio.jpg" alt="fancy folio Tasty Trends in Themeforest Templates" title="fancyfolio"  width="576" height="409" class="alignnone size-full wp-image-1553" style="border:none;" /><br />
</a><a href="http://fearlessflyer.com/u/fancyfolio">You can view the Item here</a>, or <a href="http://theme-planet.com/fancyfolio/ "target="_blank">Demo from Here</a></p>
<h3>Wild Slideshow Transitions</h3>
<p>May it be Flash or Javascript &#8211; I&#8217;ve noticed a trend in transitions. The &#8220;fade&#8221; and the &#8220;sweep&#8221; no longer suffice, check out the slideshows in the templates below for a better demonstration. </p>
<h6><a href="http://fearlessflyer.com/u/perception">Perception</a></h6>
<p>Sliced, reversed, waves &#8211; the slideshow on Perception will leave you breathless.</p>
<p><a href="http://fearlessflyer.com/u/perception"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/perception.jpg" alt="perception Tasty Trends in Themeforest Templates" title="perception" width="576" height="323" class="alignnone size-full wp-image-1559" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/perception">You can view the Item here</a>, or <a href="http://pexeto.com/perception_wp/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/cleancut">CleanCut</a></h6>
<p>The transition effects on CleanCut will give your images that &#8220;Wow&#8221; factor.</p>
<p><a href="http://fearlessflyer.com/u/cleancut"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/cleancut.jpg" alt="cleancut Tasty Trends in Themeforest Templates" title="cleancut" width="576" height="323" class="alignnone size-full wp-image-1549" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/cleancut">You can view the Item here</a>, or <a href="http://www.kriesi.at/themes/cleancut/ "target="_blank">Demo from Here</a>
</p>
<h6><a href="http://fearlessflyer.com/u/infinite">Infinite xHTML/CSS Theme</a></h6>
<p>The slideshow on this template is a combination of many styles, played in random order. Tastefully done.</p>
<p><a href="http://fearlessflyer.com/u/infinite"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/infinite.jpg" alt="infinite Tasty Trends in Themeforest Templates" title="infinite" width="576" height="323" class="alignnone size-full wp-image-1554" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/infinite">You can view the Item here</a>, or <a href="http://www.grupolasalida.com/themeforest/infinite/light/ "target="_blank">Demo from Here</a></p>
<h3>Accordions</h3>
<p>Instead of the regular slideshow, some templates integrate an Accordion effect (or both) right in the home page. Both are somewhat similar, though the Accordion is a new trend that gives your website that out of the ordinary style. </p>
<h6><a href="http://fearlessflyer.com/u/innovation">Innovation + Science</a></h6>
<p>Definitely of of my favorites &#8211; Innovation + Science is very sleek, sharp and clean. The accordion is a good choice for this template.</p>
<p><a href="http://fearlessflyer.com/u/innovation"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/innoscience.jpg" alt="innoscience Tasty Trends in Themeforest Templates" title="Gorgeous Accordion Here" width="576" height="450" class="showtip alignnone size-full wp-image-1555" style="border:none;" /><br />
</a><a href="http://fearlessflyer.com/u/innovation">You can view the Item here</a>, or <a href="http://warp.nazwa.pl/dc/innovation/index.html "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/newscast">Newscast</a></h6>
<p>Again, one of my favorites &#8211; this template&#8217;s got it all: typography, spacing, color, javascript effects &#8211; and of course the accordion. Probably the best magazine styled theme I&#8217;ve ever seen.</p>
<p><a href="http://fearlessflyer.com/u/newscast"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/newscast.jpg" alt="newscast Tasty Trends in Themeforest Templates" title="You have to check out Newscast" width="576" height="476" class="showtip alignnone size-full wp-image-1558" style="border:none;" /><br />
</a><a href="http://fearlessflyer.com/u/newscast">You can view the Item here</a>, or <a href="http://www.kriesi.at/demos/newscast/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/echoes">Echoes</a></h6>
<p>Awesome, awesome, awesome!!! This template simply <em>echoes</em> &#8220;awesome!&#8221;</p>
<p><a href="http://fearlessflyer.com/u/echoes"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/echoes.jpg" alt="echoes Tasty Trends in Themeforest Templates" title="Im so awesome, awesome, awesome" width="576" height="323" class="showtip alignnone size-full wp-image-1551" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/echoes">You can view the Item here</a>, or <a href="http://echoes.imaginemthemes.com/wp/ "target="_blank">Demo from Here</a></p>
<h3>Minimalist </h3>
<p>Just as the title describes, minimalist styled websites try to achieve the best look out of the least styling. The aim of the minimalist is to present beauty out of pure simplicity.</p>
<h6><a href="http://fearlessflyer.com/u/europa">Europa</a></h6>
<p>Big solid fonts, grayscale schema, massive spacing &#8211; this template speaks simple yet beauty.</p>
<p><a href="http://fearlessflyer.com/u/europa"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/europa.jpg" alt="europa Tasty Trends in Themeforest Templates" title="europa" width="576" height="323" class="alignnone size-full wp-image-1552" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/europa">You can view the Item here</a>, or <a href="http://alaja.info/europa/wordpress/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/squared3">Squared3</a></h6>
<p>Squared3 has good typography, as well as excellent color scheme. </p>
<p><a href="http://fearlessflyer.com/u/squared3"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/squared3.jpg" alt="squared3 Tasty Trends in Themeforest Templates" title="squared" width="576" height="323" class="alignnone size-full wp-image-1560" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/squared3">You can view the Item here</a>, or <a href="http://www.practicefieldadv.com/wp/squared3/ "target="_blank">Demo from Here</a></p>
<h6><a href="http://fearlessflyer.com/u/minimalistic">Minimalistic Studio</a></h6>
<p>This template should also have been in the &#8220;Wild Slideshow Transitions&#8221; category, again &#8211; a nice solid template with simple accents and design applications yet effective results. </p>
<p><a href="http://fearlessflyer.com/u/minimalistic"><br />
<img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/minimalisticstudio.jpg" alt="minimalisticstudio Tasty Trends in Themeforest Templates" title="minimalistic" width="576" height="323" class="alignnone size-full wp-image-1556" /><br />
</a></p>
<p><a href="http://fearlessflyer.com/u/minimalistic">You can view the Item here</a>, or <a href="http://minimalistic-studio.wpstall.com/ "target="_blank">Demo from Here</a></p>
<h3>Conclusion</h3>
<p>There you have it, a collection of tasty design trends in themeforest templates. What did you think of them? Would you buy any of these templates? Did you at least get inspired to build something as beautiful? Do you notice any other trends in Themeforest or elsewhere that is worth mentioning? Let me know your thoughts in the comments section: </p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Pretty Hover Effects with CSS and jQuery</title>
		<link>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/</link>
		<comments>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 01:14:17 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1509</guid>
		<description><![CDATA[This article will show you how to create pretty hover effects for your images using jQuery and CSS. The plan is to use a clean mark up, adding the necessary elements on the fly. What this means is that we are starting from barebones image HTML tags, with title attributes only. This can come useful ]]></description>
			<content:encoded><![CDATA[<p>This article will show you how to create pretty hover effects for your images using jQuery and CSS. The plan is to use a clean mark up, adding the necessary elements on the fly. What this means is that we are starting from barebones image HTML tags, with title attributes only.  This can come useful especially if you already have hundreds of images that you want to apply this effect on. </p>
<div class="viewdemo">
<a href="http://demo.fearlessflyer.com/html/demo/pretty-hovers/">View the Demo:</a>
</div>
<div class="special">
Or Download the source files from <a href="http://fearlessflyer.com/downloads/Pretty-Hovers.zip">Here.</a> Also, feel free to browse the rest of my <a href="http://fearlessflyer.com/downloads/">downloadable stuff</a>
</div>
<p>Take a look at our markup:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;images/77335_4871.jpg&quot; title=&quot;Autumn Leaves&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/107023_5283.jpg&quot; title=&quot;Cloudy Skies&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1282015_12556521.jpg&quot; title=&quot;Nice Horsy&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1262387_19591724.jpg&quot;  title=&quot;Grassy Meadows&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/220121_3233.jpg&quot; title=&quot;Jigsaw Pieces&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1282209_96954111.jpg&quot; title=&quot;Retro Groove&quot;  /&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Pretty clean right? Ok, now we start manipulating and styling with code:</p>
<h3>Step 1: Wrapping Elements with jQuery</h3>
<p>We are going to use jQuery to find all these images in a list item and check if it has a title attribute. If it does, it will wrap the image in a DIV with class name “<em>wrapper</em>”.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; 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: #003366; font-weight: bold;">var</span> thumbs <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul li img&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
&nbsp;
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> ii <span style="color: #339933;">=</span> thumbs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> ii<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span> <span style="color: #339933;">&amp;&amp;</span> thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>								
				$<span style="color: #009900;">&#40;</span>thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=&quot;wrapper&quot; /&gt;'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>jQuery will also take the contents of the image’s title and place it inside another DIV called “<em>caption</em>” and place it inside <strong>wrapper</strong>, right after the image itself. Finally, let&#8217;s remove the title attribute from the image tag.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> imgtitle <span style="color: #339933;">=</span> thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span><span style="color: #339933;">;</span>	
after<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=<span style="color: #000099; font-weight: bold;">\'</span>caption<span style="color: #000099; font-weight: bold;">\'</span>&gt;'</span> <span style="color: #339933;">+</span> imgtitle <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>.
				<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>					
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Now take a look at our mark up when the document loads:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;
&lt;div class=”wrapper”&gt;&lt;img src=&quot;images/77335_4871.jpg&quot; /&gt;&lt;/div&gt;
&lt;div class=”caption”&gt; Autumn Leaves&lt;/a&gt;
&lt;/li&gt;
...
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Pretty slick right? Now let&#8217;s move forward.</p>
<h3>Step 2: General Styling with CSS</h3>
<p>Now that we have our DIVs in place, we can now set up the general styles with our stylesheet. What we’re trying to achieve is to hide the caption from a viewing area set on its containing DIV: wrapper. </p>
<p>Take a look at our stylesheet:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.wrapper</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">218px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">218px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.caption</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Note that the wrapper dimensions are taken from how wide and tall the images are.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/pretty-hovers1.jpg" style="border:none" title="Pretty Hover Effects with CSS and jQuery photo" alt="pretty hovers1 Pretty Hover Effects with CSS and jQuery" /></p>
<h3>Step 3: Events and More Styling with jQuery </h3>
<p>Now back to our script, all we need to do now is assign a couple of events to the hover method of our wrapper DIV.  Thankfully, jQuery’s <strong>.hover()</strong> simplifies this action by letting us bind two handlers (in and out) all within the same context. </p>
<p>All we need to achieve is a way to slide the caption DIV upwards when we hover (maybe decrease the opacity of the image), then slide the DIV back downwards when we mouse out:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.wrapper'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; 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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;.6&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.caption'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>top<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;-85px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><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: #003366; 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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1.0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.caption'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>top<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;85px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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></pre></td></tr></table></div>

<p>Notice that I also used the <strong>.animate()</strong> function for manipulating the CSS properties which renders all of our effects smoothly. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/pretty-hovers2.jpg" style="border:none;" title="Pretty Hover Effects with CSS and jQuery photo" alt="pretty hovers2 Pretty Hover Effects with CSS and jQuery" /></p>
<h3> Optional Pretty Styling:</h3>
<p>For demonstration purposes I’ve added pretty backgrounds, as well as font types to maximize the effect. Simply add a background to the DIV caption, and assign different font types and styles (check out <a href="http://code.google.com/webfonts">Google Fonts</a>). </p>
<p>There you have it. You have just created your own image hover effects using jQuery and CSS. You can download the source code from <a href="http://fearlessflyer.com/downloads/Pretty-Hovers.zip">here</a>, or <a href="http://demo.fearlessflyer.com/html/demo/pretty-hovers/">view the live demo</a>. </p>
<p>Please feel free to comment below on what you think of this tutorial. </p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>High Quality HTML and PSD Porfolio template &#8211; &#8220;Sifiso&#8221;</title>
		<link>http://fearlessflyer.com/2010/05/html-and-psd-template-sifiso/</link>
		<comments>http://fearlessflyer.com/2010/05/html-and-psd-template-sifiso/#comments</comments>
		<pubDate>Mon, 17 May 2010 18:31:43 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[HTML and PSD]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[PSD]]></category>
		<category><![CDATA[Quality]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1468</guid>
		<description><![CDATA[This time around I&#8217;m selling a gorgeous HTML template with the Photoshop files for &#8220;Sifiso&#8221;. Sifiso is a one page &#8220;portfolio-like&#8221; template which you can use for your personal site. It features bold colors, transparent elements as well as hard to miss extra large icons. Sifiso is ideal for web designers, illustrators and photographers; You ]]></description>
			<content:encoded><![CDATA[<p>This time around I&#8217;m selling a gorgeous HTML template with the Photoshop files for <em>&#8220;Sifiso&#8221;</em>. Sifiso is a one page &#8220;portfolio-like&#8221; template which you can use for your personal site. It features bold colors, transparent elements as well as hard to miss extra large icons. Sifiso is ideal for web designers, illustrators and photographers; You can use Sifiso as a final product for your own site, or as a good starting point for your clients. Sifiso costs $5 &#8211; for both the PSD files and source code</p>
<table>
<tr>
<td>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/sifiso/">View The Demo!</a></div>
</td>
<td style="padding-left:10px;">
<div class="buylink"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&#038;hosted_button_id=VRM5GGPRUZR2U">Buy in Paypal</a></div>
</td>
</tr>
</table>
<div class="special">Help me continue developing freebies by <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&#038;hosted_button_id=VRM5GGPRUZR2U">buying</a></strong> this download from Paypal!</div>
<h3>Features</h3>
<p>The one pager Sifiso has all the right stuff for a strong personal portfolio:</p>
<div class="one"><strong>a catchy introduction area</strong> &#8211; a sexy summary of what you do. You have to edit the text in the PSD to change this section</div>
<div class="two"><strong>a testimonials section </strong>- sport what your clients say about you. Simply edit the text inside the p tags in the HTML</div>
<div class="three"><strong>a spot for quotes </strong>- maybe a couple of words from famous people in your industry, again &#8211; open the PSD to edit this area</div>
<div class="four"><strong>showcase area</strong> &#8211; screenshots of your best stuff, add your own pictures and edit the HTML.</div>
<div class="five"><strong>finally, a contact form</strong> &#8211; how else will they get a hold of you? This will have to be done in a server side language of your choice</div>
<p><a href="http://demo.fearlessflyer.com/html/demo/sifiso/"><img class="alignnone size-full wp-image-1474" style="border: 0;" title="Features for Sifiso" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/full2.jpg" alt="full2 High Quality HTML and PSD Porfolio template   Sifiso" width="576" height="1100" /></a></p>
<h3>How to Edit</h3>
<p>The source code is very pretty straightforward &#8211; simply edit the HTML with your own. The PSD contains 4 files &#8211; one for each main section of the page. All files are layered, grouped and labeled. To edit a text section &#8211; find the layer and edit the text within. Fonts used are &#8220;AR Blanca&#8221; (for the logo), and &#8220;Helvetica Nueu LT Std&#8221; for everything else.</p>
<p><img class="alignnone size-full wp-image-1477" title="Editing Sifiso" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/how-to-edit.jpg" alt="how to edit High Quality HTML and PSD Porfolio template   Sifiso" width="576" height="400" /></p>
<h3>Conclusion</h3>
<p>Keep in mind that even though Sifiso may be full of images, it is still coded professionally to conform to standards and SEO. I hardly used any &#8220;image&#8221; tags (except for the portfolio section), and still used HTML text where it should be (see screenshot below).</p>
<p><img class="alignnone size-full wp-image-1478" title="Sifiso is SEO friendly" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/seo.jpg" alt="seo High Quality HTML and PSD Porfolio template   Sifiso" width="576" height="400" /></p>
<p>*Note that I talked about how to code this way in my 3 part post: <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">How to create a single page portfolio from scratch</a></strong>.</p>
<div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/sifiso/">View The Demo!</a></div>
<p>Credits to the icon developers:Coffee Mug by <a href="http://omercetin.deviantart.com/art/Apple-Mug-Icons-and-Extras-152648713"> Omercitin</a>, Paintbrushes by <a href="http://artdesigner.lv/en/archives/342">ArtDesigner.lv</a> and Briefcase by <a href="http://thirteen-eightyone.deviantart.com/art/Briefcase-149934549">thirteen eightyone</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/05/html-and-psd-template-sifiso/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP</title>
		<link>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/</link>
		<comments>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 02:40:16 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1369</guid>
		<description><![CDATA[Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding ]]></description>
			<content:encoded><![CDATA[<p>Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding and hiding sections and a modal view of images – also known as a “<strong>lightbox</strong>” effect. And to wrap it all up, we will add a small PHP snippet into our footer so we will have a working contact form. </p>
<div class="viewdemo">
<a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a>
</div>
<div class="special">
This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong>
</div>
<p>Are you ready to get your hands dirty? Let’s start coding:</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/part3.jpg" alt="part3 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Part 3 of 3" width="576" height="189" class="alignnone size-full wp-image-1370" style="border:0;" /></p>
<h3>Convert the Feature into a jQuery Powered Slideshow:</h3>
<p>Our feature section looks good as it is. Though it would be better if the large image on the right would change and cycle through other images. In other words, we need to convert it into a slideshow of our best work. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp1.jpg" alt="sp1 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Well convert this into a slideshow" width="576" height="323" class="alignnone size-full wp-image-1371" /></p>
<h4>Adding the Script Files</h4>
<p>First thing we need to do is download jQuery. jQuery will be powering all of the javascript we’re using for our page. Head on to <a href="http://jquery.com/">http://jquery.com/</a>, download and save it into our current directory. </p>
<p>Inside the head section of our HTML, insert our script tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Now all of jQuery’s magic is in our fingertips. Download the slideshow plugin from:  <a href="http://jquery.malsup.com/cycle/">http://jquery.malsup.com/cycle/</a>. Right below our first script tag, insert directly below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery.cycle.all.2.72.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
	$(document).ready(function(){
		//cycle plugin
		$('.slideshow').cycle({
			fx: 'fade' 
		});
&lt;/script&gt;</pre></td></tr></table></div>

<h4>Getting the images ready:</h4>
<p>Now that our scripts are intact, let’s get our images and our stylesheet ready so the animation will take place. Open <strong>feature.png</strong> in Photoshop and create new guides as shown below. Make sure you cut right down to the pixel. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp2.jpg" alt="sp2 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Add new guides" width="576" height="547" class="alignnone size-full wp-image-1372" /></p>
<p>Cut out the center image and fill with solid color.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp3.jpg" alt="sp3 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Fill with color" width="576" height="547" class="alignnone size-full wp-image-1373" /></p>
<p>Save the file under the same name.</p>
<p>Create several images that will go inside the slideshow -<strong> all must have the same dimensions</strong> &#8211; in our case: 476 pixels and 349 pixels. </p>
<p>Insert the HMTL right below the feature div. Of course you will replace the image names with your images, along with the right path:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;slideshow&quot;&gt;
&lt;img src=&quot;images/feature-1.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-2.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-3.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-4.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-5.jpg&quot;/&gt;		
&lt;/div&gt;</pre></td></tr></table></div>

<p>Append this code inside your existing style.css file:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #6666ff;">.slideshow</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-24px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This ensures that the slideshow will sit on top of the designated box in the feature div:</p>
<p>Preview index.html in your browser. By now you should see your new slideshow swapping your images in your feature section: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp4.jpg" alt="sp4 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Our slideshow is in place" width="576" height="323" class="alignnone size-full wp-image-1374" /></p>
<p><strong>Next up: The expanding sections, and the “lightbox” effect.</strong></p>
<h3>Adding the “More” click events on the sections below the fold:</h3>
<p>We have two sections below the fold that showcase what our work is all about. One is the useful “<strong>Testimonials</strong>” section – where visitors read what others are saying about our services. And of course, the “<strong>Previous Work</strong>” area – where you plug in screenshots of work that you’ve done. This may be websites, photographs, software; anything that can be screen captured you can apply. </p>
<p>The point is to only show a few of testimonials, and a few thumbnails of your previous work. When visitors click on the “<strong>More</strong>” buttons, the section expands to show the rest. </p>
<p>This approach is also best for people who have plenty of work, but only would like to show a little at first. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp5.jpg" alt="sp5 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="The More Buttons" width="576" height="630" class="alignnone size-full wp-image-1375" /></p>
<p>Insert the code below inside the <strong>$(document)</strong>.ready function:</p>

<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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2), #previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-testimonials'&gt;More Testimonials&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-previous-work'&gt;More Previous Work&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>		
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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></pre></td></tr></table></div>

<p>The above code first hides our testimonial DIVS (that are greater than 3) and our previous work list items (that are greater than 4). Then it alters the HTML of our buttons, as well as toggle our hidden sections to appear while sliding slowly. </p>
<h3>Adding the light show effect for the Portfolio gallery: </h3>
<p>For the portfolio thumbnails &#8211; it would really be nice to add a “lightbox” effect once the images are clicked. Lightbox provide a way for viewers to see the detailed image without physically leaving the page. For our portfolio &#8211; we’re using <a href="http://fancybox.net/">http://fancybox.net/</a></p>
<p>Download: <a href="http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip">http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip</a><br />
Extract the files and copy the folder “<strong>fancybox</strong>” from the unzipped file and place in the root folder of our portfolio. Inside index.html, place the code in the head section:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;./fancybox/jquery.fancybox-1.2.6.pack.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./fancybox/jquery.fancybox-1.2.6.css&quot; media=&quot;screen&quot; /&gt;</pre></td></tr></table></div>

<p>Inside our custom script tag, (right after the last “<strong>});</strong>”) insert the block of code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.zoom&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancybox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'zoomSpeedIn'</span>	<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'zoomSpeedOut'</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>In our unordered list of thumbnails, insert this “<strong>class</strong>” and “<strong>rel</strong>” attributes for each anchor tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">class=&quot;zoom&quot; rel=&quot;group&quot;</pre></div></div>

<p>Refresh <strong>index.html</strong> in your browser and click a thumbnail. You should now see the effects of Fancy box from your portfolio:</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp-unknown.jpg" alt="sp unknown Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="The lightbox effect" width="576" height="323" class="alignnone size-full wp-image-1377" /></p>
<p><strong>Last step: The contact form.</strong></p>
<h3>Completing the Contact Form with PHP</h3>
<p>Since HTML and javascript doesn’t support contents of a form to be sent through email, we need a little help from PHP to bring our contact form to life. We are now working with server side technology, so won’t be able to test our file without a web server. So in order to test our code, upload your file to your web host or run apache locally using <strong>WAMP</strong> or <strong>MAMP</strong>. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp6.jpg" alt="sp6 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Server side code needs a web server" width="576" height="400" class="alignnone size-full wp-image-1380" /></p>
<p>First thing we have to do is change the extension of <strong>index.html</strong> to <strong>.php</strong>. We will be working with the .php file from now on. You can discard the .html version – or keep it for archive. </p>
<p>Look for the form tag inside <strong>index.php</strong>; add a method and an action attribute:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form id=&quot;contact-form&quot; method=&quot;post&quot; action=&quot;&quot;&gt;</pre></div></div>

<p>This enables our form to use the <strong>$_POST</strong> array and be processed by the same page. To test the contents of our post array, type the following code right above the form:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;pre&gt;
&lt;?php print_r($_POST) ?&gt;</pre></td></tr></table></div>

</pre>
<p>Now, add some stuff to the form fields, click “<strong>Submit</strong>” and see what our pre tags have spitted out: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp7.jpg" alt="sp7 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Contents of our post array" width="576" height="400" class="alignnone size-full wp-image-1381" /></p>
<p>Now we know what we need to work with as far as the contents of our post array. We can now remove the  pre tags and continue to work on our code. Add the following code on the very top of the page (even before the !DOCTYPE declaration):</p>

<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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//see number 1</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'send'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//see number 2</span>
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'youremail@mail.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is your email address</span>
	<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From Your Contact Form'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  
		<span style="color: #666666; font-style: italic;">//see number 3</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Name: <span style="color: #006699; font-weight: bold;">$name</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Email: <span style="color: #006699; font-weight: bold;">$email</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Comments: <span style="color: #006699; font-weight: bold;">$comments</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//see number 4</span>
	<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</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;">?&gt;</span></pre></td></tr></table></div>

<p><strong>What the above code is doing: </strong></p>
<div class="one">checks to see if the “<strong>submit</strong>” button has been clicked by checking if an array key by the name of “send” exists. If it does, the rest of the code executes:</div>
<div class="two">we’re creating several variables that we can work with – this includes $to – email address to send to, along with the contents of the post array</div>
<div class="three">we’re compiling the message by concatenating the variables we’ve created</div>
<div class="four">finally, the “<strong>mail</strong>” function which is what allows you send mail</div>
<p>Now it’s time to test the code. Enter your email address into the <strong>$to</strong> variable then upload index.php to your web server. Fill out the form fields and click “<strong>submit</strong>”. You should receive an email similar to below:</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp8.jpg" alt="sp8 Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP" title="Sample Email" width="576" height="291" class="alignnone size-full wp-image-1382" /></p>
<p>Now remember <strong>that this is a stripped down version of a contact form</strong>. You should seriously consider adding several things such as form validation and formatting the entries for safe and legitimate values. Also add error and success messages to let the user know what’s going on. (I won’t cover such things because as you can see – this tutorial has gone waaay too long).</p>
<h3>Final Words</h3>
<p>There you have it - a complete single page portfolio. We started all the way from scratch: Mocked up the concept in Photoshop, hand coded the HTML, while slicing the images and writing the CSS. We've added some jQuery magic as well as a little bit of PHP functionality. As you see - a lot of work does go into it (and that's just a single page!)</p>
<p>In closing, I hope that you may learn something from this 3 part series. I also would like to thank the script and plugin developers which I included in this tutorial. You can <strong><a href="http://fearlessflyer.com/downloads/single-page-portfolio-final.zip">download the finished product from this link</a></strong>, and of course<strong><a href="http://demo.fearlessflyer.com/html/demo/one/"> view the live demo</a></strong> from here. </p>
<p>I also suggest that you find a <a href="http://www.hostingobserver.com/server-hosting.php"><strong>web hosting server</strong></a> that works well with HTML, PHP and jQuery. This will take care of all your hosting needs.</p>
<div class="special">
This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong>
</div>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>16 Beautiful Restaurant Websites</title>
		<link>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/</link>
		<comments>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 20:23:34 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[restaurant]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1196</guid>
		<description><![CDATA[One of the challenging parts of web design is to provide exactly what your client needs. Some of them look to advertise a product. Others offer some kind of service, while the rest want a website for general information about their organization. Recently, I had to design for a local restaurant. Restaurant owners are quite ]]></description>
			<content:encoded><![CDATA[<p>One of the challenging parts of web design is to provide exactly what your client needs. Some of them look to advertise a product. Others offer some kind of service, while the rest want a website for general information about their organization. Recently, I had to design for a local restaurant. Restaurant owners are quite the hybrid of all the clientele types I mentioned because they:  1) want a website to advertise their products *usually in a menu form, 2) promote their services and friendly staff and 3) show the world about their fine establishment. </p>
<p>As I was searching the net for good restaurant websites, I stumbled upon these 16 sites which had all the elements that my client needed.  In addition, some of these websites look so good – that it would inspire many of you designers out there. Note that I included my work in the list (its my blog &#8211; I can do whatever I want).</p>
<p><strong><a href="http://thenoodlebox.net/">http://thenoodlebox.net/</a></strong><br />
<a href="http://thenoodlebox.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/the-noodle-box.jpg" alt="the noodle box 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1211" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.rubytuesday.com/">http://www.rubytuesday.com</a></strong><br />
<a href="http://www.rubytuesday.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/ruby-tuesdays.jpg" alt="ruby tuesdays 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1208" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.twelve-restaurant.co.uk/">http://www.twelve-restaurant.co.uk/</a></strong><br />
<a href="http://www.twelve-restaurant.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/twelve-restaurant.jpg" alt="twelve restaurant 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1213" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.pizzaza.ca/">http://www.pizzaza.ca/</a></strong><br />
<a href="http://www.pizzaza.ca/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/pizzaza.jpg" alt="pizzaza 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1206" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.nuevo-aurich.de/">http://www.nuevo-aurich.de/</a></strong><br />
<a href="http://www.nuevo-aurich.de/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/nuevo-aurich.jpg" alt="nuevo aurich 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1205" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.pomonavalleyminingco.com/">http://www.pomonavalleyminingco.com/</a></strong><br />
<a href="http://www.pomonavalleyminingco.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/pomona-valley-mining.jpg" alt="pomona valley mining 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1207" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.lapizarraproject.com/">http://www.lapizarraproject.com/</a></strong><br />
<a href="http://www.lapizarraproject.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/la-pizarra.jpg" alt="la pizarra 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1204" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.villagerkent.com/">http://www.villagerkent.com/</a></strong><br />
<a href="http://www.villagerkent.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/the-villager.jpg" alt="the villager 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1212" title="16 Beautiful Restaurant Websites photo" /></a></p>
<div style="margin:15px 0; clear:both;">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-6163174599932698";
/* Square-inside-aparatus-article */
google_ad_slot = "7491372685";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
</div>
<p><strong><a href="http://www.bertoldis.ca/">http://www.bertoldis.ca/</a></strong><br />
<a href="http://www.bertoldis.ca/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/bertoldis.jpg" alt="bertoldis 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1198" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.caferouge.co.uk/">http://www.caferouge.co.uk/</a></strong><br />
<a href="http://www.caferouge.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/cafe-rouge.jpg" alt="cafe rouge 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1199" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://jakesrh.net/">http://jakesrh.net/</a></strong><br />
<a href="http://jakesrh.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/jakes-roadhouse.jpg" alt="jakes roadhouse 16 Beautiful Restaurant Websites" title="I did this!" width="576" height="323" class="alignnone size-full wp-image-1203" /></a></p>
<p><strong><a href="http://www.belgo-restaurants.co.uk/">http://www.belgo-restaurants.co.uk/</a></strong><br />
<a href="http://www.belgo-restaurants.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/belgo.jpg" alt="belgo 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1197" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.giraffe.net/">http://www.giraffe.net/</a></strong><br />
<a href="http://www.giraffe.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/giraffe.jpg" alt="giraffe 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1200" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.sandiegobrewing.com/">http://www.sandiegobrewing.com/</a></strong><br />
<a href="http://www.sandiegobrewing.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/san-diego-brewing.jpg" alt="san diego brewing 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1209" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.hoddows-gastwerk.de/">http://www.hoddows-gastwerk.de/</a></strong><br />
<a href="http://www.hoddows-gastwerk.de/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/hoddows.jpg" alt="hoddows 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1201" title="16 Beautiful Restaurant Websites photo" /></a></p>
<p><strong><a href="http://www.strada.co.uk/">http://www.strada.co.uk/</a></strong><br />
<a href="http://www.strada.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/strada.jpg" alt="strada 16 Beautiful Restaurant Websites" width="576" height="323" class="alignnone size-full wp-image-1210" title="16 Beautiful Restaurant Websites photo" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</title>
		<link>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/</link>
		<comments>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 23:30:22 +0000</pubDate>
		<dc:creator>michael soriano</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[single page portfolio]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://fearlessflyer.com/?p=1035</guid>
		<description><![CDATA[Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in ]]></description>
			<content:encoded><![CDATA[<p>Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in my case I’m using Dreamweaver) and multiple browsers for page testing. We’re also going to toggle between these tools a lot so be prepared to switch programs by using alt + tab often. </p>
<div class="viewdemo">
<a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a>
</div>
<div class="special">
This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong>
</div>
<p>To preview what we are going to build &#8211; <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">see the demo page</a></strong>. Just in case you missed the first tutorial, click <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">here</a></strong>. So are you ready to get started? Let’s begin: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/part2.jpg" alt="part2 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="This is Part 2 of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1122" style="border:0;" /></p>
<h3>The Wrap, Header and Feature Divs</h3>
<p>First of all, you will notice that our layout doesn’t really have anything in the header. This is because I’m sure you will use your own logo for your design &#8211; so I left that out. Second, is there really is no need for a navigation bar because we’re only building a single page. Although we may include some anchors in this area so we can quickly jump from one section of the page to another. Also important to recognize that most modern websites now have a large “feature” section which packs the main message of the website. This effect is proven to be pretty effective &#8211; that’s why we’re applying the same concept to our portfolio site. </p>
<p>In Dreamweaver, create a new HTML page, name it “<strong>index.html</strong>” and save it. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp1.jpg" alt="sp1 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="New HTML document in Dreamweaver" width="576" height="478" class="alignnone size-full wp-image-1037" /></p>
<p>Create a CSS document &#8211; name it “<strong>styles.css</strong>” and save it in the same location as “index.html”. Link to the stylesheet from index.html by using a link tag:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;link type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>  href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;styles.css&quot;</span> rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> /<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Now, we create the main DIV &#8211; we’ll call this the “<strong>wrap</strong>”. In this DIV we’ll house almost all of our elements (all but one: the footer &#8211; which I’ll explain later). In index.html, enter the code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;div id<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;wrap&quot;</span><span style="color: #00AA00;">&gt;</span>  &lt;/div<span style="color: #00AA00;">&gt;</span>&lt;!--wrap--<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Next, we grab the body style of our page. Go to Photoshop and open our mockup. Flatten the image (“<strong>Layer</strong>” > “<strong>Flatten Image</strong>”) and grab a piece of background: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp2.jpg" alt="sp2 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Grab a piece for the background" width="576" height="334" class="alignnone size-full wp-image-1038" /></p>
<p>Still in Photoshop, press Ctrl + C to copy the selected area, create a new document &#8211; and paste (this will be our HTML body background that will span horizontally). Save this file as “<strong>body-bg.gif</strong>” inside a folder called “<strong>images</strong>” in our root directory.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp3.jpg" alt="sp3 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Save as body-bg.gif" width="576" height="478" class="alignnone size-full wp-image-1039" /></p>
<p>Next is we apply some fixin’s to our CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#125;</span>
  body<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/body-bg.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #cc00cc;">#f3f2ed</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The above code tells everything to reset to 0 padding and 0 margin. It also applies the body background to the image we just created, repeat it horizontally and apply the color #f3f2ed everywhere else. View your file in the browser, you should have something like below: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp4.jpg" alt="sp4 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="This is how our HTML looks so far" width="576" height="454" class="alignnone size-full wp-image-1040" /></p>
<p>Now remember we created the main div? That is just sitting in somewhere in the page. Let’s apply some standard measurements to it and align it so it settles perfectly in the middle of our browser. </p>
<p>Note that in the beginning of this tutorial &#8211; I was going to use the <strong>960.gs</strong> framework, but feel as though I’m cheating because the tutorial calls for “<strong>from scratch</strong>”. So I decided, I’m not using the framework and code everything by hand, hence &#8211; “<strong>from scratch</strong>”. </p>
<p>Add this code to your style.css:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#CCCCCC</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This centers our wrap in the middle of the page, as well as set the default 960 pixels width. The background color and the minimum height properties are added temporarily so we can tell from the browser what we’re working with. Refresh your page and you should have something like below:</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp5.jpg" alt="sp5 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our Wrap DIV in gray background" width="576" height="349" class="alignnone size-full wp-image-1041" /></p>
<p>Go back to index.html and add the <strong>header </strong>div inside the wrap div:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div  id=&quot;header&quot;&gt;&lt;/div&gt;&lt;!--header--&gt;</pre></div></div>

<p>Back to our style.css &#8211; add this piece of code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Refresh your browser &#8211; and you can see where our header sits nicely on top. The background color again is temporary. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp6.jpg" alt="sp6 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="See the Header?" width="576" height="349" class="alignnone size-full wp-image-1042" /></p>
<p>Next is our feature div. Create a new div tag in your index.html with the id of “<strong>feature</strong>”, place in between the “feature” divs. Add two paragraph tags inside with your own text. In my case &#8211; I’m using the default Lorem latin filler text:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;feature&quot;&gt;
&lt;p id=&quot;slogan&quot;&gt;&lt;!--your fantastic slogan goes here--&gt;&lt;/p&gt;
&lt;p&gt;&lt;!--followed by a smaller, but also fantastic slogan here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--feature--&gt;</pre></td></tr></table></div>

<p>Notice the first paragraph tag has an id of “<strong>slogan</strong>”. This is because this is the primary text that we are going to style with an image. We are treating it as regular text for SEO purposes. </p>
<p>Go back to your mock up in Photoshop and press “<strong>Step Backward</strong>” (ctrl + z + alt) several times until you get the fully layered version once again. Make sure the guides are showing &#8211; select the feature section like below: </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp7.jpg" alt="sp7 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Grab our Feature Area in Photohsop" width="576" height="454" class="alignnone size-full wp-image-1043" /></p>
<p>In your layers panel, make sure you hide all the layers that shouldn’t be shown. This includes all the background layers and text elements. The only layer that should remain is the large feature image and the borders and glow to the left. Select the feature area and hit crop (“image” > “crop”). Save this as “<strong>feature.png</strong>” inside our images folder. This will be our feature div background image:</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp8.jpg" alt="sp8 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Save as feature.png" width="576" height="413" class="alignnone size-full wp-image-1044" /></p>
<p>Now in our styles.css &#8211; add the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/feature.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">394px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Go back to your mockup and click “<strong>Step Backward</strong>” (“Edit” > “Step Backward”) to uncrop. Unhide the slogan layer and select it according to the guides. Crop once again and save this as “<strong>slogan.png</strong>”. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp9.jpg" alt="sp9 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Save as slogan.png" width="576" height="454" class="alignnone size-full wp-image-1045" /></p>
<p>Now add this code to your styles.css:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> p<span style="color: #cc00cc;">#slogan</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/slogan.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">192px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#feature</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">320px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">48px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">28px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The above code styles the two paragraph tags inside the feature div. The first one with a background image, and the next one as plain text. Now when search engines crawl our page &#8211; it still thinks both are plain text &#8211; which is a good thing. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp10.jpg" alt="sp10 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Voila! Our HTML is coming along!" width="576" height="387" class="alignnone size-full wp-image-1046" /></p>
<p>I’ve also taken out the color property in our wrap div to see how our feature looks like. Another thing to remember is that since our feature sits in its own div &#8211; it will be easy to add a slideshow or something to that effect as replacement. </p>
<p>Now that our wrap, header and feature is in place, we’re ready to move to the next sections: <strong>Testimonials and Previous Work:</strong></p>
<h3>Testimonials and Previous Work Sections</h3>
<p>If the feature section is our hard hitter &#8211; a testimonials area is our “<strong>counter punch</strong>”. Testimonials are a sure fire way of telling our viewers: “<em>we’re good &#8211; read what others are saying about me!</em>”. Also another proven way of increasing business, it is also the reason why we’re putting testimonials right below our feature section. Ready to continue coding? Let’s keep going. </p>
<p>In our index.html, add the code for our testimonials. Place this directly below our feature div:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;column first&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column last&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;/div&gt;&lt;!--testimonials--&gt;</pre></td></tr></table></div>

<p>Of course, you substitute real testimonials and authors in its place. Notice the “first” and “last” additional classes to the columns &#8211; we need this to fix our margins in our css. Next, go back to Photoshop and go backwards again so you get back to the original uncropped file. Select the Testimonials title all the way to the rightmost guide. Crop and save as “<strong>testimonials-title.jpg</strong>” inside our images folder. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp11.jpg" alt="sp11 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our Headings Background - Testimonials" width="576" height="454" class="alignnone size-full wp-image-1047" /></p>
<p>Inside styles.css, append the below code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/testimonials-title.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">260px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:georgia</span><span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span>  arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">19px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.first</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This code adds the background image that we just created to the main testimonials div. It also adds proper styling to the columns inside the div, and fixes to the margins so it remains inside our imaginary grid. </p>
<p><strong>The optional “more” tab</strong></p>
<p>The more tab is only necessary if you have more than 3 columns of testimonials that you would like to show. The point is just show 3 columns at first, and by clicking the “<strong>more</strong>” tab &#8211; more testimonial columns will slide below &#8211; most likely to be achieved by jQuery (I haven’t gotten there yet &#8211; remember &#8211; I’m writing this tutorial as I go!). </p>
<p>To add a more tab &#8211; add this code to your HMTL, right underneath the last column div:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-testimonials&quot;&gt;More  Testimonials&lt;/a&gt;
&lt;/div&gt;&lt;span id=&quot;more-1035&quot;&gt;&lt;/span&gt;</pre></td></tr></table></div>

<p>Note that we used a class for our div instead of an id. This is because this div can actually be reused in another section of our page. </p>
<p>Go back to your Photoshop file &#8211; click “<strong>Step Backwards</strong>” to the uncropped version &#8211; select the section that shows the “<strong>more testimonials</strong>” border and button according to your guides. Remember to hide the text layer over the button.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp12.jpg" alt="sp12 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our More Tab in the bottom of the section" width="576" height="454" class="alignnone size-full wp-image-1048" /></p>
<p>Crop and save this as “<strong>more-bg.jpg</strong>” inside the images folder. Add the code below to your .css file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.more</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/more-bg.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">31px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">16px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>For the “<strong>Previous Work</strong>” section &#8211; it’s pretty much the same process as testimonials. The difference is &#8211; we are actually using an unordered list instead of div columns. Add the following code inside your HTML:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;previous-work&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;last&quot;&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-previous-work&quot;&gt;More Previous  Work&lt;/a&gt;
&lt;/div&gt;&lt;!--more--&gt;
&lt;/div&gt;&lt;!--previous-work--&gt;</pre></td></tr></table></div>

<p>The thumbnail sizes are going to be 200 pixels width by152 pixels height. My sample code contains dummy thumbnails along with temporary images for the bigger image. We are incorporating a light box effect in the final product so users do not actually leave the page when viewing your gallery. Notice the addition of the “<strong>more</strong>” tab &#8211; which is again, purely optional. </p>
<p>For the “<strong>Previous Work</strong>” title &#8211; you do the same exact process in Photoshop as you did previously in the Testimonials title. Save this image in the images folder &#8211; name it: “<strong>previous-work-title.jpg</strong>”.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp13.jpg" alt="sp13 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our other Heading Image - Previous Work" width="576" height="454" class="alignnone size-full wp-image-1049" /></p>
<p>Now we add some styling to the list items, thumbnails and the entire div section:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/previous-work-title.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/thumb-bg.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">209px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">165px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #3333ff;">:hover  </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/thumb-bg-hover.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a img <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I also created a couple of thumbnail image backgrounds for the active and hover states. Again this is purely optional and I won’t go over in this tutorial.</p>
<p>Now refresh your page in your browser. You should have something like the image below. It is also good practice to start viewing your page in different browsers. This way &#8211; you can start fixing bugs this early in the development process. Next stop is the <strong>footer</strong>. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp14.jpg" alt="sp14 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="The fold and below the fold become unfolded" width="576" height="566" class="alignnone size-full wp-image-1050" /></p>
<h3>The Footer</h3>
<p>Let’s go back to our Photoshop file &#8211; you may have to go back in history a couple of times to get you to the uncropped, fully layered version. Another thing to remember is <strong>NOT</strong> to save your original mock up file. This file is to stay in its original form &#8211; we are just cropping, hiding layers as we go to get the parts we want. But in the whole, this mockup .psd file remains in its original state. Select the footer area &#8211; starting from the guide a few pixels above the dark brown area. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp15.jpg" alt="sp15 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our Footer in Photoshop" width="576" height="566" class="alignnone size-full wp-image-1051" /></p>
<p>Once selected &#8211; crop the selection &#8211; but don’t save as of yet; we’re going to save a couple of images from this selection &#8211; one is the footer wrap, the other is the actual footer background. </p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp16.jpg" alt="sp16 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Grab a piece for our background" width="576" height="204" class="alignnone size-full wp-image-1052" /></p>
<p>Once cropped, select the first 20 pixels from the left and crop once again. Save this file as “<strong>footer-wrap.gif</strong>” inside our images folder. Now go back to the Photoshop file and step backwards a couple of times to bring us to entire cropped footer image. Hide the layer group named “<strong>form</strong>”, as well as all the text layers in the footer area.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp17.jpg" alt="sp17 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Hide Layers and save as the main footer background" width="576" height="388" class="alignnone size-full wp-image-1053" /></p>
<p>Save this file as “<strong>footer.jpg</strong>” in the images folder. Unhide the text layer that says “Hire Me for Professional Work”, and hide all the background layers so you get full transparency. Select the text area using the rectangular marquee tool and crop. Save this file as “<strong>slogan2.png</strong>” in our images folder.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp18.jpg" alt="sp18 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our slogan as .png image" width="576" height="194" class="alignnone size-full wp-image-1054" /></p>
<p>Now hit “<strong>Step Backward</strong>” (ctrl + alt + z) a couple of times to get to the uncropped footer image and unhide the “<strong>form</strong>” group of layers. Make sure you hide all the layers inside the form &#8211; all we need is the rounded container that embodies the form. Select this area, crop and save this file as “<strong>form-bg.png</strong>” in our images folder.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp19.jpg" alt="sp19 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our Form background - save as form-bg.png" width="576" height="269" class="alignnone size-full wp-image-1055" /></p>
<p>Finally, unhide the button text, shape and glow. Create guides that surround the button image and select accordingly. Crop and save as “<strong>submit.png</strong>” in our images folder.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp20.jpg" alt="sp20 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Thats one kick ass submit button!" width="576" height="192" class="alignnone size-full wp-image-1056" /></p>
<p>Now go back to our index.html, add the following code right underneath the entire wrap div.</p>

<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
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;footer-wrap&quot;&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;div id=&quot;left-container&quot;&gt;
&lt;p id=&quot;slogan2&quot;&gt;Hire Me for Professional  Work&lt;/p&gt;
&lt;p&gt;&lt;!--your footer slogan in this section&lt;/p&gt;
&lt;/div&gt;&lt;!--left-container--&gt;
&nbsp;
&lt;form id=&quot;contact-form&quot;&gt;
&nbsp;
&lt;div id=&quot;split-left&quot;&gt;
  &lt;label  for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br/&gt;
  &lt;input name=&quot;name&quot; id=&quot;name&quot;  type=&quot;text&quot; class=&quot;formbox&quot;/&gt;&lt;br /&gt;
  &lt;label  for=&quot;email&quot;&gt;Email:&lt;/label&gt;&lt;br /&gt;
  &lt;input name=&quot;email&quot; id=&quot;email&quot;  type=&quot;text&quot; class=&quot;formbox&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;!--split-left--&gt;
  &lt;label  for=&quot;comments&quot;&gt;Comments:&lt;/label&gt;&lt;br /&gt;
  &lt;textarea name=&quot;comments&quot;  id=&quot;comments&quot; type=&quot;textarea&quot; class=&quot;formbox&quot;  /&gt;&lt;/textarea&gt;
  &lt;input name=&quot;send&quot; id=&quot;send&quot;  type=&quot;submit&quot; value=&quot;&quot; class=&quot;send&quot;  /&gt;
&lt;/form&gt;
&nbsp;
&lt;/div&gt;&lt;!--footer--&gt;
&lt;/div&gt;&lt;!--footer-wrap--&gt;</pre></td></tr></table></div>

<p>The above code sets up all the content in the footer. This includes the two paragraphs on the left side and the contact form. Note that the form is still static. We will be converting this into a working form once we convert this to PHP. </p>
<p>Next up, is to style the contact form. Add the following code to your styles.css:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer-wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/footer-wrap.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">940px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/footer.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> <span style="color: #cc00cc;">#left-container</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/form-bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">427px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">169px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">78px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#split-</span><span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">170px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> label<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#9e876b</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #6666ff;">.formbox</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">7px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/submit.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">101px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">37px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #3333ff;">:hover</span><span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/submit2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The above code sets up our footer wrap to span the entire width of the page with its own background image repeating horizontally. Now you understand why we excluded this from the main wrap div? The rest of the code applies the styling to the footer and contact form &#8211; tied to the images we created in the previous steps.</p>
<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp21.jpg" alt="sp21 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="With all the form elements in place - it looks like a form!" width="576" height="252" class="alignnone size-full wp-image-1057" /></p>
<p>Finally, we add the final touches to the two paragraph tags on the left side. Add this code to your styles.css:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer</span> p<span style="color: #cc00cc;">#slogan2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/slogan2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">123px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp22.jpg" alt="sp22 Create a Single Page Portfolio from Scratch   Part 2: HTML and CSS" title="Our SEO aware slogan and mini slogan" width="576" height="252" class="alignnone size-full wp-image-1036" /></p>
<p>That concludes are HTML and CSS tutorial on our single page portfolio. Remember, we still have the scripting side to do &#8211; which is handled by PHP and jQuery, which we&#8217;ll cover in the next series. <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">Click Here to see the DEMO Version</a></strong> of what we just created. The <strong><a href="http://fearlessflyer.com/downloads/Single-Page-Portfolio-HTML.zip">source code is also available to download</a></strong> &#8211; which includes all the files covered in this tutorial. </p>
<div class="special">
This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong>
</div>
]]></content:encoded>
			<wfw:commentRss>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: fearlessflyer.com @ 2012-02-03 18:31:06 by W3 Total Cache -->
