<?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; jQuery</title> <atom:link href="http://fearlessflyer.com/tag/jquery/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>Tue, 07 Sep 2010 21:02:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Free Kick Ass Theme built for WP 3: Rotary</title><link>http://fearlessflyer.com/2010/09/free-kick-ass-theme-built-for-wp-3-rotary/</link> <comments>http://fearlessflyer.com/2010/09/free-kick-ass-theme-built-for-wp-3-rotary/#comments</comments> <pubDate>Tue, 07 Sep 2010 20:59:50 +0000</pubDate> <dc:creator>michael soriano</dc:creator> <category><![CDATA[Freebies]]></category> <category><![CDATA[General]]></category> <category><![CDATA[WP Themes]]></category> <category><![CDATA[Wordpress Themes]]></category> <category><![CDATA[carousel]]></category> <category><![CDATA[CMS]]></category> <category><![CDATA[custom post type]]></category> <category><![CDATA[free]]></category> <category><![CDATA[free theme]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[roundabout]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[wordpress 3.0]]></category> <category><![CDATA[WP]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1833</guid> <description><![CDATA[Oh I spend too much time in front of my pc – my wife always say. This time around – I sat, designed and coded a straight how many hours and am glad to produce: Rotary. Rotary is a two column theme with tons of features including a kicker home page. It is built to [...]]]></description> <content:encoded><![CDATA[<p>Oh I spend too much time in front of my pc – my wife always say. This time around – I sat, designed and coded a straight how many hours and am glad to produce: Rotary. Rotary is a two column theme with tons of features including a kicker home page. It is built to be used with WordPress 3.0, and is centered around the idea of running your blog as a CMS. Let me explain:</p><div class="special">You can download the zip file from this <strong><a href="http://fearlessflyer.com/downloads/rotary.zip">location</a></strong>. If you like the theme &#8211; don&#8217;t forget to <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&#038;hosted_button_id=10809689">donate</a></strong>!</div><div class="viewdemo"><a href="http://rotary.fearlessflyer.com/">View the Demo</a></div><h3>Custom Post Type</h3><p>You like that carousel / slider in the home page? Well that is due to the amazing code known as the <strong><a href="http://fredhq.com/projects/roundabout/">roundabout by Fred LeBlanc</a></strong>. You can easily change the contents of this carousel in two ways:</p><h6>1) Using a custom post type</h6><p>In the left hand side of the admin area you will notice a section called “<strong>Roundabouts</strong>”. Simply add a new roundabout and give it a title, some content and attach a “<em>feature image</em>”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/09/rotary2.jpg" alt="" title="rotary2" width="576" height="483" class="alignnone size-full wp-image-1837" /></p><p>The images are automatically resized to the right dimensions. Also &#8211; you’re only allowed up to 5 roundabouts.</p><h6>2) Change the static code</h6><p>If you decide you don’t want to use the custom post type feature – you can simply change the HTML. Inside home.php you will see  an unordered list with each item as follows:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/586x360.jpg&quot; alt=&quot;Need Image Here&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;hiddendesc&quot;&gt;Need to Enter Image&lt;/div&gt;&lt;/li&gt;</pre></td></tr></table></div><p>Simply replace the values of your images, title and link and you’re set to go.</p><h3>The Navigation Menu</h3><p>This by far is my favorite 3.0 feature – custom menus. It&#8217;s simply amazing. I’ve added the code to Rotary that lets you design the main navigation of the theme.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/09/rotary3.jpg" alt="" title="rotary3" width="576" height="500" class="alignnone size-full wp-image-1838" /></p><p>Simply drag and drop items to the menu builder and save.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/09/rotary4.jpg" alt="" title="rotary4" width="576" height="175" class="alignnone size-full wp-image-1839" /></p><h3>Feature Images</h3><p>Just like the roundabout items – all posts in this theme can have its own feature image. Simply use the “<em>Set feature Image</em>” option for each post:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/09/rotary5.jpg" alt="" title="rotary5" width="576" height="550" class="alignnone size-full wp-image-1840" /></p><p>This image will show as thumbnails in the archive pages, and a medium photo inside the single page template:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/09/rotary6.jpg" alt="" title="rotary6" width="576" height="350" class="alignnone size-full wp-image-1835" /></p><h3>Conclusion</h3><p>Truly by using the features above – you can utilize the power of WordPress 3.0 as well as turn your blog into a cool CMS.  Give Rotary a spin – it’s cool, it works and it’s free!</p><p><em>So, why do I give away my themes away? </em></p><p>Because I believe in you people. I believe that if you like my work so much – that you’ll <strong><a href="http://twitter.com/_fearlessflyer">follow</a></strong> me in Twitter,<strong> <a href="http://www.facebook.com/pages/Fearless-Flyer-Design/136158589732362">like</a></strong> me in Facebook or even <strong><a href="http://feeds.feedburner.com/Fearlessflyer">subscribe</a></strong> to my feed. I believe that you <strong>WILL NOT </strong>remove my credits in the bottom of the theme. I even believe that you will <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&#038;hosted_button_id=10809689">make a small donation</a></strong> – so I can keep building other things that can be useful to you in the future.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/09/free-kick-ass-theme-built-for-wp-3-rotary/feed/</wfw:commentRss> <slash:comments>4</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" 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="" 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="" 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="" 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: #6666ff;">.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: #6666ff;">.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: #6666ff;">.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: #6666ff;">.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: #6666ff;">.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: #6666ff;">.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>3</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" /></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;" /></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>5</slash:comments> </item> <item><title>Free HTML and PSD template &#8211; Sifiso</title><link>http://fearlessflyer.com/2010/05/free-html-and-psd-template-sifiso/</link> <comments>http://fearlessflyer.com/2010/05/free-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[free]]></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 giving away an 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 giving away an 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.</p><div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/sifiso/">View The Demo!</a></div><div class="special">You can download Sifiso&#8217;s source code from <strong><a href="http://fearlessflyer.com/downloads/Sifiso-Source-Code.zip">here</a> </strong>and PSD files from this <strong><a href="http://fearlessflyer.com/downloads/Sifiso-PSD.zip">link</a></strong>.</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="" 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="" 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="" 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><div class="special">You can download Sifiso&#8217;s source code from <strong><a href="http://fearlessflyer.com/downloads/Sifiso-Source-Code.zip">here</a> </strong>and PSD files from this <strong><a href="http://fearlessflyer.com/downloads/Sifiso-PSD.zip">link</a></strong>.</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/free-html-and-psd-template-sifiso/feed/</wfw:commentRss> <slash:comments>11</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="" 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="" 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="" 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="" 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="" 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="" 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="" 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="" 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="" 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="" 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><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>4</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch &#8211; Part 1: Photoshop Mockup</title><link>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/</link> <comments>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/#comments</comments> <pubDate>Wed, 11 Nov 2009 07:20:47 +0000</pubDate> <dc:creator>michael soriano</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[HTML and PSD]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[php]]></category> <category><![CDATA[portfolio]]></category> <category><![CDATA[shiny]]></category> <category><![CDATA[Single column]]></category> <category><![CDATA[Single page]]></category> <category><![CDATA[Sleek]]></category> <category><![CDATA[Static]]></category> <category><![CDATA[Web 2.0]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=899</guid> <description><![CDATA[Ahhh &#8211; so many choices when it comes to what open source software to use: Joomla, WordPress, Drupal&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have [...]]]></description> <content:encoded><![CDATA[<p>Ahhh &#8211; so many choices when it comes to what open source software to use: <a href="http://www.joomla.org/">Joomla</a>, <a href="http://wordpress.org">WordPress</a>, <a href="http://drupal.org/">Drupal</a>&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have something existing &#8211; with cluttered content that isn’t even enough to fill a full page. This is where a single page portfolio comes handy. In this tutorial, we’re going to build a single page portfolio from scratch: a page with a feature section, testimonials, image gallery and a 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 the first of three parts: 1) the Photoshop Mock up, 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><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/part1.jpg" alt="part1" title="This is the first part of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1119"  style="border:0;"/></p><h3>The Output</h3><p>Below is a preview of what we’re building. The aim is to have a mock up that is fully layered, so we can optimize for the purpose of SEO and page performance. Ready to get started &#8211; Let’s begin:</p><p><a href="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1-large.jpg"><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1.jpg" alt="single-page-1" title="This is How the Page looks so far - Click to enlarge" width="576" height="923" class="alignnone size-full wp-image-902" /></a></p><h3>Part 1 &#8211; The Fold</h3><p>We’re going to design the page from the top to bottom. The fold is first part of a web page can see &#8211; without having to scroll downwards. In our case, this includes the header and the big red feature bar:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-0.jpg" alt="single-page-0" title="The fold is the first thing you see in a web page" width="576" height="248" class="alignnone size-full wp-image-901" /></p><p>If you aren’t familiar with 960.gs &#8211; it’s a CSS framework that follows the standard 960 pixels page width rule. Download the photoshop template and check out the guides &#8211; we are building the page following the 960 grid rules:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-2.jpg" alt="single-page-2" title="The 960 Photoshop Template showing the pink layers and guides to help you align elements" width="576" height="581" class="alignnone size-full wp-image-904" /></p><p>Create a new layer &#8211; this will be the fold layer. Select the full page width, with approximately 380 pixels in height. Fill it with a solid color &#8211; in my case I chose a bright red #730701:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-3.jpg" alt="single-page-3" title="The Fold Fill Layer" width="576" height="581" class="alignnone size-full wp-image-905" /></p><p>Create another layer for the header bar, select the full page width and 48 pixels in height. Fill this with another solid color &#8211; in my case, #bcbcbc for light grey.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-4.jpg" alt="single-page-4" title="The Header Fill Layer" width="576" height="581" class="alignnone size-full wp-image-906" /></p><p>Where the header bar and the fold meet, we want to add an “etched” effect. We achieve this by using 2 lines using the “line” tool. Create 2 horizontal lines at 1 pixel each (make sure you hold the “Shift” key) as you drag it across the page. Nudge one line so that they sit just on top of one another. The rule is to use a lighter shade for one line, and a darker for the other (it is important that you play with the colors, and zoom out and test if the etched look is achieved). Add a subtle gradient fill for the header bar as well.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-5.jpg" alt="single-page-5" title="Two Horizontal Lines create an Etched Effect" width="576" height="313" class="alignnone size-full wp-image-907" /></p><p>The next step is to add a large feature image. This sits on top of all the layers to give it that 3D effect. Place in at almost half the 960 pixel page width, overlapping some part of the header and pass below the fold. Include the effects as shown:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-6.jpg" alt="single-page-6" title="Large Overlapping Feature Images are So In!" width="576" height="308" class="alignnone size-full wp-image-908" /></p><p>Immediately to the left of the feature image, add your large slogan text. This is to be your attention grabbing statement, and is important to be the most prominent. I chose Rockwell at size 36 pixels, with -50 tracking. Also add the following text effects:</p><ul><li>Drop shadow &#8211; Normal blend mode &#8211; #000, 90 degrees angle, 1px distance, 0 spread and 1px in size</li><li>Inner Shadow  &#8211; Normal blend mode &#8211; #FFF, 90 degrees angle, 1px distance, 0 choke and 0px size</li><li>Gradient Overlay &#8211; use default settings, reduce opacity to 34% and 90 degrees in angle</li></ul><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-7.jpg" alt="single-page-7" title="Large Slogan Text with my Favorite font - Rockwell" width="576" height="581" class="alignnone size-full wp-image-909" /></p><p>Add a gradient effect to the background layer named the fold. The rule is to use a slightly lighter color than the existing background as one color, and the same background color as the secondary color. Fill by pressing the shift key and releasing simultaneously.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-8.jpg" alt="single-page-8" title="Add some gradient effects Baby!" width="576" height="418" class="alignnone size-full wp-image-910" /></p><p>Add another 2 horizontal lines right underneath the slogan text. *Use the rule as described in the previous line tools used in the header and the fold separation. Add a smaller set of text &#8211; I used Arial with 14 pixels in size, #FFFFFF color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-9.jpg" alt="single-page-9" title="Here goes that Etched Borders again" width="576" height="452" class="alignnone size-full wp-image-911" /></p><p>To complete the fold &#8211; we add a glow effect to the bottom area where the borders separate the large text and the small text. Select a small area (shown below), grab the brush tool, select white for the color, increase the brush radius (shown below) &#8211; reduce the opacity all the way to 12 percent and daub a quick light stroke.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-10.jpg" alt="single-page-10" title="Give it a little glow" width="576" height="425" class="alignnone size-full wp-image-912" /></p><h3>Part 2 &#8211; Below the Fold</h3><p>Below the fold technically includes everything under the fold. But for the sake of this tutorial &#8211; it includes all BUT the footer section. The reason is &#8211; this will be the only part that will need to grow. If there was additional content to be made &#8211; it will be inside this section. The fold and the footer remain static in height.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-11.jpg" alt="single-page-11" title="Below the fold is the area you see when you scroll downwards" width="576" height="476" class="alignnone size-full wp-image-913" /></p><p>We start by creating a new layer. With the selection tool, select everything below the red feature section below. Fill this selection with #f3f2ed using the paint bucket tool. *Note that the large image layer should be placed on top of all the other layers.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-12.jpg" alt="single-page-12" title="Layer should be beneath the large image layer!" width="576" height="581" class="alignnone size-full wp-image-914" /></p><p>We then create a new horizontal guide. This guide should be right below our feature image (allow a few pixels extra for the added shadow effect). This guide’s main purpose is to know where we will slice our divs (which I will cover once we start coding) and where our gradient ends. Grab the selection tool once more and start from where the red area ends &#8211; down to the new guide. Using the gradient tool, select #e1decf primary color and #f3f2ed and fill with a straight line (hold shift).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-13.jpg" alt="single-page-13" title="So subtle gradients are soo nice!" width="576" height="314" class="alignnone size-full wp-image-915" /></p><p>We then add that same “etched” look where the two layers meet. The same technique is used &#8211; create two lines with one darker and one lighter. In this case the upper line has #670600 fill and the second #faf9f3.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-14.jpg" alt="single-page-14" title="Again - etched borders!" width="576" height="203" class="alignnone size-full wp-image-916" /></p><p>Next step is to create the sub heading. With the type tool, choose the Rockwell font at 24 pixels in #292929 color and type the word “TESTIMONIALS”. Directly to the left of the text &#8211; I imported the “users_two_48” icon from <a href="http://wefunction.com/2008/07/function-free-icon-set/">WeFunction</a> and scaled the image down to 60 percent and desaturize (Ctrl + U, slide the saturation all the way to the left).  Add two horizontal 1 pixel lines (#e5e5e2 and #FFFFFF) directly underneath (by this point of the tutorial, I’m going to assume you have this technique down already).</p><p>*Tip &#8211; Create a group called “sub headings” and add all the above elements in it. We will be duplicating this sub heading in following sections.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-15.jpg" alt="single-page-15" title="WeFunction icons - desaturated please" width="576" height="430" class="alignnone size-full wp-image-917" /></p><p>Directly below the Testimonial subheading &#8211; we create 3 text boxes with some dummy text. I used Verdana at 14 pt, 20 pt leading. Make sure you allow enough padding and margin around each surrounding box. Align according to the grid. Note that this part of the design acts only as a marker. We will use actual text for these boxes.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-16.jpg" alt="single-page-16" title="Three boxes make up the testimonials section" width="575" height="479" class="alignnone size-full wp-image-918" /></p><p>Duplicate the two horizontal lines from the sub headings section. Move these 2 lines right below the 3 text boxes that you have created. Create a new layer, select 124 pixels (width) x 25 pixels (height) and fill with #FFFFFF with the paint bucket tool. Move this layer right below the two horizontal lines. Using the text tool, use 10 pt Verdana, color # 6b6b6b and type the words “more testimonials” &#8211; move this directly on top of the new layer we’ve just created. This acts as end marker for the testimonials section with a button that displays more testimonials.</p><p>*Tip &#8211; create a new group for the above elements and name it “end marker”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-17.jpg" alt="single-page-17" title="More buttons for added user interaction" width="576" height="288" class="alignnone size-full wp-image-919" /></p><p>Next, we add a “Previous Work” section. Remember that we created a group called “sub headings” a little while back? Duplicate this group and name it “sub headings 2”. Using the down cursor in your keyboard, move the new group approximately 560 pixels downwards. Change the text to say “PREVIOUS WORK” and use another icon, scale it down and desaturate.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-18.jpg" alt="single-page-18" title="Another Heading with a desaturated icon" width="576" height="281" class="alignnone size-full wp-image-920" /></p><p>An image gallery will showcase our portfolio’s “Previous Work” section. Similar to the testimonials area, we are dropping some dummy thumbnails in our photoshop file, just for mock purposes. We are going to span 4 thumbnails across at 210 pixels each in width. Make sure the thumbnails align to the grid, taking 3 columns each with enough paddings in between each other. Add the following effects for each thumbnail: Drop Shadow (settings shown in below screenshot) and an inside stroke of 6 pixels and #FFFFFF fill color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-19.jpg" alt="single-page-19" title="Photo gallery of your previous work" width="576" height="720" class="alignnone size-full wp-image-921" style="border:0;"/></p><p>To complete the “Below the Fold” section &#8211; we create an end marker for the “Previous Work” area. Duplicate the group “end marker” and name it “end marker 2”. Move this newly created group approximately 380 pixels downwards. Change the text in the button to say “more previous work”. Our next quest is the <strong>Footer</strong>. Keep going!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-20.jpg" alt="single-page-20" title="Again, a more button is added below" width="576" height="319" class="alignnone size-full wp-image-922" /></p><h3>Part 3 &#8211; The Footer</h3><p>And now we come to the final piece of the design process &#8211; the Footer. I enjoy designing footers because they represent completion; they’re also the most overlooked section of a page that I feel that it deserves the same attention as the other parts.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-21.jpg" alt="single-page-21" title="After user sees your work - they would want to get in touch with you!" width="576" height="206" class="alignnone size-full wp-image-923" /></p><p>The height of the footer is approximately 375 pixels. If you haven’t already done so &#8211; extend your canvas size to an additional 375 pixels &#8211; but be sure to click the anchor all the way to the top.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-22.jpg" alt="single-page-22" title="Canvas settings for your Footer" width="576" height="391" class="alignnone size-full wp-image-924" style="border:0;"/></p><p>Create 3 new horizontal guides: first is where the “Below the Fold” background ends, then approximately 35 pixels below, and third &#8211; another 30 pixels down (this is where the footer background layer starts). Make a selection from the first guide to the next one down, make sure you’re on the “Below the fold” background layer, and do a gradient fill: primary color #e3e0d2, secondary #f3f2ed. Next, create a new layer for the footer background and add a gradient fill: primary color is #361f01 and secondary #493215. Do 80 percent for the primary fill. Finally, create 3 horizontal lines with the line tool at 1 pixel each with the following fills (in the following order): #ffffff, #000000 and #624825. Line them according the last guide you’ve created (see below).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-23.jpg" alt="single-page-23" title="Gradients and Horizontal Lines are good" width="576" height="581" class="alignnone size-full wp-image-925" /></p><p>Duplicate the text layer for the slogan (The Fold), change the content to say “Hire me for professional work”, drag downwards to the footer, and place on the left half of the footer area. Add another text area, use Verdana, 12px #ffffff, enter some dummy text, and place directly below the large text.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-24.jpg" alt="single-page-24" title="Slap the same text effect onto the footer slogan to match the header" width="576" height="225" class="alignnone size-full wp-image-926" /></p><p>On the right half of the footer, we’re placing a rounded rectangle for the background of the contact form. Using the Rounded Rectangle tool &#8211; create a rectangle, center between 6 columns in the grid. Add a drop shadow and stroke effect as shown below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-25.jpg" alt="single-page-25" title="A rounded container for the form" width="576" height="880" class="alignnone size-full wp-image-927" style="border:0;" /></p><p>Create a new layer and make 3 rectangles inside the rounded rectangle we’ve just created. These will act as the form fields. Note that these are just as markers which will not really be used in the output. We’re using real form fields in the code. Fill these rectangles with #ffffff using the paint bucket tool.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-26.jpg" alt="single-page-26" title="Form fields are useful" width="576" height="352" class="alignnone size-full wp-image-928" /></p><p>What’s a contact form without a pretty submit button? Using the rounded rectangle tool &#8211; create a button and add an inner shadow (66 percent opacity) and a 1px inner stroke &#8211; #85827e. Add the text “Submit” on top of this button using “Rockwell” at 14px.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-27.jpg" alt="single-page-27" title="We need a submit button" width="576" height="161" class="alignnone size-full wp-image-929" /></p><p>Finally, remember I said the footer should have the same detail as the other parts of the page? We’re going to add a nice glow in the background which will highlight our large text and the contact form. Select the footer background with the selection tool. Next, pick a soft round brush at 500 pixels, select color #ffffff and decrease the opacity of the brush to 10 percent. Center the brush horizontally and halfway above the footer &#8211; click once and Voila &#8211; instant glow in the background!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-28.jpg" alt="single-page-28" title="Finish up with a nice glow" width="576" height="529" class="alignnone size-full wp-image-930" /></p><p>And there you have it. We’ve just created a full page mockup in Photoshop. Next will be coding the HMTL and CSS &#8211; so stay tuned!</p><div class="special"> This tutorial is the first of three parts: 1) the Photoshop Mock up, 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><strong>You can download the .psd from this <a href="http://fearlessflyer.com/downloads/one-page-portfolio-psd.zip">link</a></strong></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Free WP Theme &#8211; Pork and Beans!</title><link>http://fearlessflyer.com/2009/07/pork-and-beans-download-for-free/</link> <comments>http://fearlessflyer.com/2009/07/pork-and-beans-download-for-free/#comments</comments> <pubDate>Sun, 19 Jul 2009 23:57:38 +0000</pubDate> <dc:creator>michael soriano</dc:creator> <category><![CDATA[Freebies]]></category> <category><![CDATA[General]]></category> <category><![CDATA[WP Themes]]></category> <category><![CDATA[Wordpress Themes]]></category> <category><![CDATA[blog theme]]></category> <category><![CDATA[Free WP Theme]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[premium]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[twin column]]></category> <category><![CDATA[wood]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=680</guid> <description><![CDATA[Just finished another theme to add to my collection and I must say, I am just now getting the real hang of this theme production. This time around, I went a little unorthodox. That&#8217;s not true &#8211; It is a regular two column design; it does have the standard navigation; the sidebar is in the [...]]]></description> <content:encoded><![CDATA[<p>Just finished another theme to add to my collection and I must say, I am just now getting the real hang of this theme production. This time around, I went a little unorthodox. That&#8217;s not true &#8211; It is a regular two column design; it does have the standard navigation; the sidebar is in the right side; The archive, single and  other template are intact; but I did throw in a lot of Javascript, bolder color schema and a combination of rounded corners, etches and fades.</p><div class="viewdemo"><a href="http://pork.fearlessflyer.com">View the Demo</a></div><h3>Javascript / jQuery Goodness</h3><p>I&#8217;m a big fan of animation in web design. Especially ones that enhance your pages functionality, accessibility and of course &#8211; quality. This is the case in the tabbed containers that you get in Pork and Beans&#8217; top sidebar and comments form.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/07/pork-and-beans-2.jpg" alt="pork-and-beans-2" title="I went a little crazy with the jQuery Tabs" width="576" height="323" class="alignnone size-full wp-image-683" /></p><p>The code is from <a href="http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial">Queness</a>, I was able to squeeze a lot of content into such constrained spaces. Content that are to be grouped logically in the first place. For instance, in the comments area, the form shows up as default, but you can also switch from a selection of subscription options, as well as a list of related posts.</p><p>Other Javascript features include the sliding captions on the images &#8211; courtesy of <a href="http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/">Buildinternet.com</a>, and a Scroll to the top button found in the footer area.</p><h3>Colors Schema, Aesthetics and Auto Resizable Images,</h3><p>The original design didn&#8217;t include a wood background, nor was there a patch of grass in the footer &#8211; but I figured, it needed some identity. I know what you&#8217;re thinking: What does it have to do with &#8220;Pork and Beans&#8221;? Absolutely nothing. Who said the name had to relate anyway? Picked up the color scheme from the &#8220;Moboogie&#8221; Color template from Adobe&#8217;s <a href="http://kuler.adobe.com/">Kuler</a> website. Images are automatically resized using a custom field entry (image). For best results, use images wider than 562 pixels.</p><h3>Plugins Needed</h3><p>The sidebar has a Flickr Box included which will need you to download the <a href="http://eightface.com/wordpress/flickrrss/">flickrRSS plugin </a>by Eightface. The sidebar is also fully widgetized, styled to match the rest of the page&#8217;s elements. You will also need the <a href="http://rmarsh.com/plugins/similar-posts/">Similar Posts</a> plugin by Rob Marsh &#8211; which will pull related posts to the current article. This will show right below a single article, in the last tab in the comments form.</p><h3>Conclusion</h3><p>Pork and Beans is ideal for the traditional blogger. Although it may work best with people who have high quality and vivid photos to include with their articles. I do not suggest customizing it to match another look &#8211; since the colors and the background images will be difficult to mess with. Well, if you really must need to tweak, then by all means. I must also mention that I started to code to satisfy IE 6 quirks &#8211; but gave up. There is also a bug that the body background shifts to the right on scroll, but goes back to the original position. I don&#8217;t know what causes it, but if any of you experience the same thing &#8211; please leave a comment.</p><p>You can see Pork and Beans live in action from this <a href="http://pork.fearlessflyer.com/">link</a>, <strong>Download the theme from <a href="http://fearlessflyer.com/downloads/pork-and-beans.zip">here</a></strong>. All I ask is to spread the word, leave a comment or follow me in <a href="http://twitter.com/mks6804">Twitter</a>.</p><p><strong>Update &#8211; You can now download the <a href="http://fearlessflyer.com/downloads/pork-and-beans-psd.zip">PSD:</a>. Note that the PSD does not look exactly like the demo (changed my mind a couple of times during coding).</strong></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/07/pork-and-beans-download-for-free/feed/</wfw:commentRss> <slash:comments>41</slash:comments> </item> <item><title>How to Create a Slick jQuery Login Form for WordPress</title><link>http://fearlessflyer.com/2009/06/how-to-create-a-slick-jquery-login-form-for-wordpress/</link> <comments>http://fearlessflyer.com/2009/06/how-to-create-a-slick-jquery-login-form-for-wordpress/#comments</comments> <pubDate>Sat, 20 Jun 2009 01:57:53 +0000</pubDate> <dc:creator>michael soriano</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Login Form]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=624</guid> <description><![CDATA[Every WordPress site has its login form in its own page located at: yoursite/wp-admin. But what if you want this form to appear in a more convenient place such as your header template? This will add flexibility to your blog by making your admin pages more accessible. Furthermore, adding a little jQuery makes this form [...]]]></description> <content:encoded><![CDATA[<p>Every WordPress site has its login form in its own page located at: yoursite/wp-admin. But what if you want this form to appear in a more convenient place such as your header template? This will add flexibility to your blog by making your admin pages more accessible. Furthermore, adding a little jQuery  makes this form semi-visible by having a toggle switch.</p><h3>The Images</h3><p>I only used a couple of images for the form. First is the little tab that extends just right below the edge of our browser that when clicked, shows the entire form. Second is the actual login button. Note that you don’t have to create any images at all for this form – regular CSS styling would look fine. In my case – I used rounded edges for a more stylistic look; hence the need for images:</p><p><img class="alignnone size-full wp-image-625" title="Images needed" src="http://fearlessflyer.com/main/wp-content/uploads/2009/06/jquery-login-1.jpg" alt="jquery-login-1" width="576" height="101" /></p><h3>The Form</h3><p>This is where the functionality kicks in. This code came from Kriesi’s post: “<a href="http://www.kriesi.at/archives/admin-login-on-your-front-page">Admin login in your front page</a>”.  His code is basically a valid login form that can reside in any page of your WordPress site. An else condition is also included that shows additional options for when the user is logged in. I added a table (that’s correct, I used a TABLE! – so shoot me!) for the input fields and labels to behave and align accordingly. Of course – you can omit the table if you want to. I’ve also added several DIV elements so our form can be housed in a little box.</p><p>This part shows when the user isn’t logged in:</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;quick-login&quot;&gt;
&lt;div id=&quot;login-form&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_0'</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: #000000; font-weight: bold;">?&gt;</span>
&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-login.php&quot; method=&quot;post&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;label for=&quot;label&quot;&gt;User&lt;/label&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;label for=&quot;label&quot;&gt;Password&lt;/label&gt;
&lt;em class=&quot;forgot&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-login.php?action=lostpassword&quot;&gt;Forgot?&lt;/a&gt;&lt;/em&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&amp;amp;amp;amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;log&quot; id=&quot;log&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_specialchars<span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user_login</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; size=&quot;20&quot; class=&quot;login-fields&quot; /&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;input type=&quot;password&quot; name=&quot;pwd&quot; id=&quot;pwd&quot; size=&quot;20&quot; class=&quot;login-fields&quot;/&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&quot; class=&quot;login-button&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;redirect_to&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;</pre></td></tr></table></div><p>This code shows when the user IS logged in. I’ve also included my own message for the logged in user. You should adjust this to accommodate your theme.</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="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;logged-in-box&quot;&gt;
&lt;p&gt;You can now quickly edit your posts by clicking the &lt;em&gt;Edit This&lt;/em&gt; &amp;nbsp;buttons after each post&lt;/p&gt;
&lt;ul class=&quot;admin_box&quot;&gt;
&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/&quot;&gt;Dashboard&lt;/a&gt;&lt;/li&gt; 
&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;logout&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--logged-in-box--&gt; 
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;&lt;!--login-form--&gt;</pre></td></tr></table></div><h3>The CSS</h3><p>Now that we have all the elements in place, we can proceed with styling them. Note the color for the tab image is the background color for the entire DIV. Another important property is “display:none” &#8211; which hides the form by default. This is what jQuery will toggle to “display:block” when we’re done.</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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #6666ff;">.menu_class</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;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/button-toggle3.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;">184px</span><span style="color: #00AA00;">;</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;">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;">outline-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#login-form</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;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</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><span style="color: #cc00cc;">#397846</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#login-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;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span><span style="color: #993333;">uppercase</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;">11px</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;">5px</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;">font-family</span><span style="color: #00AA00;">:</span>verdana<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;">5px</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: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#login-form</span> em a <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#a1dbe6</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;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</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;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">37px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#login-form</span> em 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>
input<span style="color: #6666ff;">.login-fields</span> <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;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#444444</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;">5px</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;">2px</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: #00AA00;">&#125;</span>
input<span style="color: #6666ff;">.login-button</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;">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;">36px</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/login-btn.png</span><span style="color: #00AA00;">&#41;</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: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#logged-in-box</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;">456px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#logged-in-box</span> p <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;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">238px</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;">14px</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;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</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: #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>
<span style="color: #cc00cc;">#logged-in-box</span> p em <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#a1dbe6</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.admin_box</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;">20px</span> <span style="color: #933;">20px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.admin_box</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;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</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: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.admin_box</span> li a<span style="color: #00AA00;">&#123;</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;">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-transform</span><span style="color: #00AA00;">:</span><span style="color: #993333;">uppercase</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;">11px</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;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.admin_box</span> li 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;">#ccc</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><h3>The jQuery</h3><p>Our form is complete, styles and all. The last thing we need is the action. We accomplish this by adding jQuery. First of, don’t forget to reference the library and your custom script in your head section:</p><div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/scripts/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/scripts/js/slider.js&quot;&gt;&lt;/script&gt;</pre></div></div><p>Then the following few lines of code is what we include in our custom script (“slider.js”).</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>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;">'a.menu_class'</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: #009900;">&#40;</span><span style="color: #3366CC;">'div#login-form'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'medium'</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;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>And that’s it! You have created a slick jQuery powered login form for your WordPress site. This particular form is designed to be placed in your header file. Note that the form will work from any template in your theme. <strong>Give the <a href="http://blue.fearlessflyer.com/home/jquery-demo/">demo</a> a try</strong> – I’ve designated a test user account so you can see how the form looks when logged in.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/06/how-to-create-a-slick-jquery-login-form-for-wordpress/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: fearlessflyer.com @ 2010-09-09 11:31:13 -->