<?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>Willy P&#039;s Blog</title>
	<atom:link href="http://wpaoli.building58.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpaoli.building58.com</link>
	<description>Mostly a site with a jQuery tabslideout plugin...</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:55:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Super simple jQuery content swapper</title>
		<link>http://wpaoli.building58.com/2009/10/super-simple-jquery-content-swapper/</link>
		<comments>http://wpaoli.building58.com/2009/10/super-simple-jquery-content-swapper/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 04:25:20 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=269</guid>
		<description><![CDATA[See Example Page
Just need a simple way to swap content out using javascript real quick? This seems to come up a lot in my life. On a recent job interview I was given a task to do this and the following is what I came up with. I&#8217;m positive this has been done many times [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://building58.com/example/content-switcher/">See Example Page</a></p>
<p>Just need a simple way to swap content out using javascript real quick? This seems to come up a lot in my life. On a recent job interview I was given a task to do this and the following is what I came up with. I&#8217;m positive this has been done many times already in different and superior ways, but, I like this simple implementation, and thought I&#8217;d share it for others to use and build upon. Enjoy&#8230;<br />
<span id="more-269"></span></p>
<h2>The HTML</h2>
<p>For the markup, you just need a list for your navigation, and blocks of content for your content. Each content block needs a unique id to link to from your nav and the class of &#8216;content&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#page1&quot;</span>&gt;</span>Page 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#page2&quot;</span>&gt;</span>Page 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#page3&quot;</span>&gt;</span>Page 3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#page4&quot;</span>&gt;</span>Page 4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>									
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page1&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Page 1 content<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- page 1 content --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page2&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Page 2 content<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Page 2 content --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page3&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Page 3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Page 3 content --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page4&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Page 4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- page 4 content --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h2>The jQuery javascript</h2>
<p>Concept here is hide every content block except the active one. When a nav item is clicked, show the correct content:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span> contentSwitcher<span style="color: #009900;">&#40;</span>settings<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> settings <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
           contentClass <span style="color: #339933;">:</span> <span style="color: #3366CC;">'.content'</span><span style="color: #339933;">,</span>
           navigationId <span style="color: #339933;">:</span> <span style="color: #3366CC;">'#navigation'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">//Hide all of the content except the first one on the nav</span>
        $<span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">contentClass</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">not</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':first'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">navigationId</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li:first'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">//onClick set the active state, </span>
        <span style="color: #006600; font-style: italic;">//hide the content panels and show the correct one</span>
        $<span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">navigationId</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> contentToShow <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            contentToShow <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>contentToShow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//dissable normal link behaviour</span>
            e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//set the proper active class for active state css</span>
            $<span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">navigationId</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//hide the old content and show the new</span>
            $<span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">contentClass</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>
            contentToShow.<span style="color: #660066;">show</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;">&#125;</span>
    contentSwitcher<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></div></div>

<p>I know this is missing many features (bookmarkableness for one), but a simple starting point. Enjoy&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/10/super-simple-jquery-content-swapper/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery &#8216;Tab Slide Out&#8217; Plugin</title>
		<link>http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/</link>
		<comments>http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 07:07:43 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=198</guid>
		<description><![CDATA[A couple weeks ago, I made this pull out slider thing using jQuery. (people use them as &#8216;feedback&#8217; tabs) I decided to try making it into a plugin for jQuery and here it is. Use it for creating a feedback form, contact info, or any content which is revealed using a sliding animation by clicking [...]]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago, I made this <a href="http://wpaoli.building58.com/2009/08/jquery-animated-feedback-tab-thingy/">pull out slider thing</a> using jQuery. (people use them as &#8216;feedback&#8217; tabs) I decided to try making it into a plugin for jQuery and <a href="http://www.building58.com/examples/tabSlideOut.html">here it is</a>. Use it for creating a feedback form, contact info, or any content which is revealed using a sliding animation by clicking on a tab. Not sure how to describe it, check out the <a href="http://www.building58.com/examples/tabSlideOut.html">example</a>.</p>
<p><a href="http://www.building58.com/examples/tabSlideOut.html">See example page</a><br />
<a onclick="pageTracker._trackEvent('Download Code','jquery.tabSlideOut.v1.3.js');" href="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js">Download the plugin</a><br />
<a href="http://www.building58.com/examples/tabSlideOut.zip">Download sample project files</a></p>
<p>You can apply the tabSlideOut object to a div that you want to become hidden content that is revealed by a tab.<span id="more-198"></span></p>
<h2>Type the html</h2>
<p>Create a div that will contain the hidden content. You will need a link in there with the class of &#8216;handle&#8217;. This is what will be replaced by your image and be the &#8216;tab&#8217; or &#8216;handle&#8217; that will stick out form the side of the screen.</p>
<p>html:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide-out-div&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;handle&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://link-for-non-js-users&quot;</span>&gt;</span>Content<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>This is extra content<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Something that wasn't important enough to be in your main body, 
   but that you wanted to hide off the side of your screen for some reason.
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Could be a form to submit feedback, or contact info<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h2>Style it however you wish with css</h2>
<p>Really doesn&#8217;t matter how you style it but it does require a <strong>width</strong> This is how I styled mine:</p>
<p>css:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.slide-out-div</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;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#29216d</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Create your &#8216;tab&#8217; graphic</h2>
<p>I used photoshop and made this one:<br />
<a href="http://wpaoli.building58.com/wp-content/uploads/2009/09/contact_tab.gif"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/09/contact_tab.gif" alt="contact_tab" title="contact_tab" width="40" height="122" class="alignnone size-full wp-image-196" /></a></p>
<p>You can use any graphic you want, although make a note of the <strong>height and width</strong> of the image because you need to define that in the plugin options.</p>
<h2>Set the plugin options</h2>
<p>The most important options to set are the first four in the following list. Everything else is just for fun. Comments in the code explain what each option is for.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.slide-out-div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabSlideOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    tabHandle<span style="color: #339933;">:</span> <span style="color: #3366CC;">'.handle'</span><span style="color: #339933;">,</span>                              <span style="color: #006600; font-style: italic;">//class of the element that will be your tab</span>
    pathToTabImage<span style="color: #339933;">:</span> <span style="color: #3366CC;">'images/contact_tab.gif'</span><span style="color: #339933;">,</span>          <span style="color: #006600; font-style: italic;">//path to the image for the tab *required*</span>
    imageHeight<span style="color: #339933;">:</span> <span style="color: #3366CC;">'122px'</span><span style="color: #339933;">,</span>                               <span style="color: #006600; font-style: italic;">//height of tab image *required*</span>
    imageWidth<span style="color: #339933;">:</span> <span style="color: #3366CC;">'40px'</span><span style="color: #339933;">,</span>                               <span style="color: #006600; font-style: italic;">//width of tab image *required*    </span>
    tabLocation<span style="color: #339933;">:</span> <span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span>                               <span style="color: #006600; font-style: italic;">//side of screen where tab lives, top, right, bottom, or left</span>
    speed<span style="color: #339933;">:</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">,</span>                                        <span style="color: #006600; font-style: italic;">//speed of animation</span>
    action<span style="color: #339933;">:</span> <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>                                   <span style="color: #006600; font-style: italic;">//options: 'click' or 'hover', action to trigger animation</span>
    topPos<span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span><span style="color: #339933;">,</span>                                   <span style="color: #006600; font-style: italic;">//position from the top</span>
    fixedPosition<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>                               <span style="color: #006600; font-style: italic;">//options: true makes it stick(fixed position) on scroll</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To see all these pieces working together as well as some code to copy/paste see the <a href="http://www.building58.com/examples/tabSlideOut.html">working example here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/feed/</wfw:commentRss>
		<slash:comments>152</slash:comments>
		</item>
		<item>
		<title>Horizontal Nav with &#8220;animated sub-navs&#8221;</title>
		<link>http://wpaoli.building58.com/2009/08/horizontal-nav-with-animated-drop-down-sub-navs-jquery-plugin/</link>
		<comments>http://wpaoli.building58.com/2009/08/horizontal-nav-with-animated-drop-down-sub-navs-jquery-plugin/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 04:55:04 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=249</guid>
		<description><![CDATA[Yet another jQuery plugin ;-)
A designer friend of mine was working on his portfolio and was searching for a way to animate his horizontal navigation bar so that the sub-navs would drop down smoothly. In helping him implement a couple of scripts he found online, I decided to write a simple one myself. Turned out [...]]]></description>
			<content:encoded><![CDATA[<p><em>Yet another <a href="http://jquery.com/">jQuery</a> plugin ;-)</em></p>
<p>A designer friend of mine was working on his portfolio and was searching for a way to animate his horizontal navigation bar so that the sub-navs would drop down smoothly. In helping him implement a couple of scripts he found online, I decided to write a simple one myself.<em> Turned out to not be quite as &#8217;simple&#8217; as I had hoped, but I like how this one is coming along.</em> Again using the powerful magic known as <a href="http://jquery.com/">jQuery</a>, I was able to animate a nested list and make it all work nice. I decided to go ahead and make it a plugin. I also had the help of the <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent</a> plugin to make it all smooth. <a href="http://www.building58.com/example/horizontal-drop-down-sub-menu/horiz-drop-down.html">Check it out&#8230;</a></p>
<p><em>If you are looking for a regular vertical drop down menu for jQuery use <a href="http://users.tpg.com.au/j_birch/plugins/superfish/">superFish</a>.</em></p>
<p><a href="http://www.building58.com/example/horizontal-drop-down-sub-menu/horiz-drop-down.html">See example page</a><br />
<a href="http://horizontal-animated-sub-nav.googlecode.com/files/jquery.horizontalnav.js">Download plugin</a><br />
<a href="http://www.building58.com/example/horizontal-drop-down-sub-menu/horiz-drop-down.zip">Download sample project</a></p>
<p>You simply apply this plugin to a nested list, and style it up and you have a nice animated sub-nav.<span id="more-249"></span></p>
<h2>The basic concept:</h2>
<p>Hide the nested ul using a negative margin-top, and have them slide down when its parent li feels a mouseover event.<br />
We start with regular markup of a nested list.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- Parent ul --&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Item
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--Nested ul--&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Sub-item 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Sub-item 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>I thought I would be able to hide the nested ul, under the parent ul using a negative margin, but this just doesn&#8217;t work, its always on top <em>(Even with position:absolute and a negative top value, and playing with z-index all day)</em>. What does work is to hide the sub-item li&#8217;s  under their own ul&#8217;s.</p>
<p>So I set overflow hidden on the nested ul, and then apply a negative margin-top to the sub-nav li&#8217;s to hide them.<br />
Check out this <a href="http://screencast.com/t/Xg8Uxgqih" target="_blank">video screencast</a> that shows how im just messing with the margin-top property. </p>
<p>Then simply animate the margin-top property using jQuery&#8217;s animate.</p>
<h2>The html:</h2>
<p>Just a normal nested list, the &#8216;right&#8217; way to have a navigation list with sub-items.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;horizontal-dropdown&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>About<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
       <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
           <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub1&quot;</span>&gt;</span>Something<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
           <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2&quot;</span>&gt;</span>Something else<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
           <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2&quot;</span>&gt;</span>What you wanna know<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
&nbsp;
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Projects<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-1&quot;</span>&gt;</span>jQuery Plugins<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-2&quot;</span>&gt;</span>Websites<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-3&quot;</span>&gt;</span>Music<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-3&quot;</span>&gt;</span>Art<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>    
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Bikes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-1&quot;</span>&gt;</span>FSR Enduro<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-2&quot;</span>&gt;</span>20in BMX<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-2&quot;</span>&gt;</span>Beach Cruiser<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>                               
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>            
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Guitars<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-1&quot;</span>&gt;</span>Charvel<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-2&quot;</span>&gt;</span>Paul Reed Smith<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-3&quot;</span>&gt;</span>Banjo<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub2-3&quot;</span>&gt;</span>Mandolin<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;last&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Contact<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<h2>The css:</h2>
<p>Basically floating everything to the left, to make it horizontal. The overflow hidden and position relative/absolute values are the main things to pay attention to here. Everything else is a just for looks.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #6666ff;">.horizontal-dropdown</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;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> a <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">40px</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;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">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/border.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> li<span style="color: #6666ff;">.last</span> a <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</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;">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;">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/top-bg.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> li<span style="color: #6666ff;">.hover</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*sub nav*/</span>
ul<span style="color: #6666ff;">.horizontal-dropdown</span> ul <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: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#3fb306</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: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> ul li <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</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: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> ul li a <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;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#3fb306</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: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">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;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.horizontal-dropdown</span> ul 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;">#0609b3</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Set the plugin options:</h2>
<p>Download the <a href="http://horizontal-animated-sub-nav.googlecode.com/files/jquery.horizontalnav.js">horizontalNav</a> and <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent</a> and bring them into your project.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.hoverIntent.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.horizontalnav.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>You should use the <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">&#8216;hoverIntent&#8217;</a> plug in along with this to make it all smooth. If you do not want to use <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent plugin</a> with this, set useHoverIntent: false</p>
<p>Then configure the plugin, to the list of your choice. Mine has the class of &#8216;horizontal-dropdown&#8217;.</p>

<div class="wp_syntax"><div 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> charset<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;utf-8&quot;</span><span style="color: #339933;">&gt;</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;">'.horizontal-dropdown'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animatedHorizontalNav</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            speed<span style="color: #339933;">:</span> <span style="color: #CC0000;">250</span><span style="color: #339933;">,</span>
            useHoverIntent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</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>
&nbsp;
    <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Any suggestions on how to improve this code is greatly appreciated.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/08/horizontal-nav-with-animated-drop-down-sub-navs-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery &#8216;drop down&#8217; sub-menus for Expression Engine&#8217;s category module</title>
		<link>http://wpaoli.building58.com/2009/08/jquery-drop-down-sub-menus-for-expression-engines-category-module/</link>
		<comments>http://wpaoli.building58.com/2009/08/jquery-drop-down-sub-menus-for-expression-engines-category-module/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:47:42 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=170</guid>
		<description><![CDATA[See the live example in the sidebar of the Navigenics blog.
Today I cleaned up a huge category list on the sidebar of Navigenics&#8217; blog.  Since the main problem we were trying to solve was to free up some side bar real estate, I was asked &#8216;is it hard to put those into a drop [...]]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://blog.navigenics.com">See the live example in the sidebar of the Navigenics blog.</a></em></p>
<p>Today I cleaned up a huge category list on the sidebar of Navigenics&#8217; blog.  Since the main problem we were trying to solve was to free up some side bar real estate, I was asked &#8216;is it hard to put those into a drop down thing?&#8217; We decided on having main category headers and then nesting sub-categories within them. I gave it a shot using the power of jQuery and I am happy with the results. <span id="more-170"></span></p>
<p>We use the default &#8220;categories&#8221; module in Expression Engine, which does not give you much flexibility in terms of how the markup is output <em>without mucking with the php or extending it with a plugin</em>. This solution allows you to keep using the default category manager and simply use a bit of javascript to bend it to your will. From the admin interface of EE, in the category manager, set up your sub categories. </p>
<h2>Set up sub-categories in Expression Engine</h2>
<p>Example:<br />
<img src="http://wpaoli.building58.com/wp-content/uploads/2009/08/Picture-11.png" alt="Picture 11" title="Picture 11" width="356" height="134" class="alignnone size-full wp-image-177" /></p>
<p>This will create html markup that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav_categories&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav_categories&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/conditions_we_test/&quot;</span>&gt;</span>Conditions we test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/crohns_disease/&quot;</span>&gt;</span>Crohn's disease<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/breast_cancer/&quot;</span>&gt;</span>Breast cancer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/diabetes/&quot;</span>&gt;</span>Diabetes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/exercise/&quot;</span>&gt;</span>Exercise<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/for_physicians/&quot;</span>&gt;</span>For physicians<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>To get the drop-down functionality I need, I want to add classes to the parent category&#8217;s &lt;li&gt; and &lt;a&gt; tags so that I have hooks for my css and javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav_categories&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav_categories&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sub-cat-heading&quot;</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cat-expander&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/conditions_we_test/&quot;</span>&gt;</span>Conditions we test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/crohns_disease/&quot;</span>&gt;</span>Crohn's disease<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/breast_cancer/&quot;</span>&gt;</span>Breast cancer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/diabetes/&quot;</span>&gt;</span>Diabetes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/exercise/&quot;</span>&gt;</span>Exercise<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/for_physicians/&quot;</span>&gt;</span>For physicians<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>Since we can&#8217;t control the markup enough with the default category module in EE, we do some jQuery dom traversing and add the classes with javascript:</p>
<h2>Add classes using jQuery</h2>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.nav_categories li'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//get all the children </span>
    .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//find only the ones that are li's</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;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//of the li's you found hide that ones that have ul's for parents (means they are sub-navs)</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: #006600; font-style: italic;">//The proud parent of the nested ul(which is a li) example--&gt;&lt;li&gt;&lt;ul&gt;</span>
    .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sub-cat-heading'</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//give the li a name in the form of a class</span>
    .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a:first'</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//get the link that is now becoming a heading</span>
    .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cat-expander'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//give that link a name so we can target it specifically it later</span></pre></div></div>

<p>This will give us the proper markup we wanted, now we add the little arrows, and the magic for the functionality.</p>
<h2>Add some css</h2>
<p><em>If you are trying to copy this exactly you will need the <a href="http://wpaoli.building58.com/wp-content/uploads/2009/08/drop_arrows.gif">drop down arrow gif</a>, or make your own.</em></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.nav_categories</span> li<span style="color: #6666ff;">.sub-cat-heading</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;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.nav_categories</span> li<span style="color: #6666ff;">.sub-cat-heading</span> a.cat-expander<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;">/assets/images/drop_arrows.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #933;">-8px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.nav_categories</span> li<span style="color: #6666ff;">.sub-cat-heading</span> a.open<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<div id="js"></div>
<h2>The final jQuery js with the drop down action</h2>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> subCatDropdownEE <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    init<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>
&nbsp;
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.nav_categories li'</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
            .<span style="color: #660066;">find</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;">hide</span><span style="color: #009900;">&#40;</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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sub-cat-heading'</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a:first'</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cat-expander'</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: #006600; font-style: italic;">//click action on the link that has now become a clickable drop-down heading</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;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//toggle adding a 'open' class to know which way to point the arrow</span>
                .<span style="color: #660066;">parents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li:first'</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//find the ul that we hid up above</span>
                .<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//slide it open if its closed, closed if its open</span>
&nbsp;
                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: #006600; font-style: italic;">//prevents the link from being a link, since its now just a trigger for our drop-down</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;">&#125;</span>
&nbsp;
subCatDropdownEE.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</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>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>I hope some ExpressionEngine peeps find this useful. Peas out.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/08/jquery-drop-down-sub-menus-for-expression-engines-category-module/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery animated feedback tab thingy</title>
		<link>http://wpaoli.building58.com/2009/08/jquery-animated-feedback-tab-thingy/</link>
		<comments>http://wpaoli.building58.com/2009/08/jquery-animated-feedback-tab-thingy/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 07:23:28 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=144</guid>
		<description><![CDATA[View Demo

Update: I have now made this into a jQuery plugin, check it out.  minus the ajax form part. Which I plan on including into the plugin in the future.

I saw this little widget being used on a couple of sites lately, and decided to try building one myself. Turned out to be pretty [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wpaoli.building58.com/wp-content/uploads/2009/08/feedback-panel.html">View Demo</a><br/></p>
<div class="alert-box">
Update: <a href="http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/">I have now made this into a jQuery plugin, <strong>check it out</strong>.</a> <em> minus the ajax form part. Which I plan on including into the plugin in the future.</em>
</div>
<p>I saw this little widget being used on a couple of <a href="http://www.startuply.com/">sites</a> lately, and decided to try building one myself. Turned out to be pretty simple using jQuery and some css foo.</p>
<p>Check out the <a href="http://wpaoli.building58.com/wp-content/uploads/2009/08/feedback-panel.html">demo of the effect</a> or you can <em>skip the bs and <a href="http://wpaoli.building58.com/2009/08/jquery-animated-feedback-tab-thingy/#js">go right to the js</a>.</em></p>
<h2>Basic concept</h2>
<p>The basic concept is to have a div hidden off the side of the page using position:absolute and a negative left value,</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.feedback-panel</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;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-291px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>and then &#8216;animate&#8217; the css left value back to zero using jQuery.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>That is the basic idea, now I will walk through how it all works&#8230;<span id="more-144"></span></p>
<h2>Step one, add this html above your closing body tag:</h2>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;feedback-panel&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;feedback-tab&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.static-formpage.com&quot;</span>&gt;</span>Feedback<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>Send Us Feedback<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form-wrap&quot;</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sendmail.php&quot;</span>&gt;</span>
      Email: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
      Message:<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">rows</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> col<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;30&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>    
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h2>Step two, style the box:</h2>
<p>This is pretty straight forward. Style a box, position it way to the left off the screen. The a.feedback-tab uses a small graphic to use as the &#8216;tab&#8217; so that I could have the vertical text. This link is positioned to the outside of the box using position:relative and float:right.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.feedback-panel</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;">20px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#bab6d8</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#29216d</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</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;">200px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-291px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.feedback-panel</span> a<span style="color: #6666ff;">.feedback-tab</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #3333ff;">:<span style="color: #993333;">transparent</span> </span>url<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">feedbacktab.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</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;">border-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">99px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">51px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</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;">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;">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;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
textarea <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">90</span>%</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: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#response-message</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Step Three, the jQuery Javascript.</h2>
<div id="js"></div>
<p>Here is the script that performs the basic animation:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> feedbackTab <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    speed<span style="color: #339933;">:</span><span style="color: #CC0000;">300</span><span style="color: #339933;">,</span>
    containerWidth<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    containerHeight<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    tabWidth<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-tab'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
&nbsp;
    init<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: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color: #339933;">,</span>feedbackTab.<span style="color: #660066;">containerHeight</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.feedback-tab'</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;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> feedbackTab.<span style="color: #660066;">containerWidth</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> feedbackTab.<span style="color: #660066;">speed</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  feedbackTab.<span style="color: #660066;">speed</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
feedbackTab.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>All this does is unhide and hide the box when you click the tab. I am getting the widths of the element using jQuery so that you can change the size of the box using css without having to worry about changing values in the js. I set the height of the box so that the box doesn&#8217;t jump to get smaller after you submit the form. </p>
<p>After the email is submitted the box will automatically close, and the tab will disappear off the screen as well. (since you have already submitted your feedback that option is removed)</p>
<p>A feedback form like this needs to be ajax so that you don&#8217;t have a page refresh, so I ended up combining this idea with a tutorial I found at <a href="http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jQuery/">NetTuts:submit a form without page refresh</a><br />
<em>I did not include any of the form validation stuff in this post because my main focus is on the animation idea, not the form itself</em><br />
Also, to be nice to people not using javascript (all .2% of you), The link will take you to another page that can have a static feedback form if javascript is not present.<br />
Here is the whole script, including the ajax form stuff I stole from the NetTut article.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> feedbackTab <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        speed<span style="color: #339933;">:</span><span style="color: #CC0000;">300</span><span style="color: #339933;">,</span>
        containerWidth<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        containerHeight<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        tabWidth<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.feedback-tab'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
        init<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: #3366CC;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color: #339933;">,</span>feedbackTab.<span style="color: #660066;">containerHeight</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.feedback-tab'</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>
&nbsp;
                <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;">'.feedback-panel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> feedbackTab.<span style="color: #660066;">containerWidth</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> feedbackTab.<span style="color: #660066;">speed</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  feedbackTab.<span style="color: #660066;">speed</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    feedbackTab.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.button&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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
        <span style="color: #003366; font-weight: bold;">var</span> email <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#email&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea#message&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> response_message <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Thank you for your comment, see ya!&quot;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> dataString <span style="color: #339933;">=</span> <span style="color: #3366CC;">'email='</span> <span style="color: #339933;">+</span> email <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;message='</span> <span style="color: #339933;">+</span> message<span style="color: #339933;">;</span>
&nbsp;
        $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
          type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span>
          url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;sendmail.php&quot;</span><span style="color: #339933;">,</span>
          data<span style="color: #339933;">:</span> dataString<span style="color: #339933;">,</span>
          success<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: #3366CC;">'#form-wrap'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id='response-message'&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;">'#response-message'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p&gt;&quot;</span> <span style="color: #339933;">+</span> response_message <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/p&gt;&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: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</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: #CC0000;">1.0</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: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</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: #3366CC;">'.feedback-panel'</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>left<span style="color: #339933;">:</span><span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>feedbackTab.<span style="color: #660066;">containerWidth</span> <span style="color: #339933;">+</span> feedbackTab.<span style="color: #660066;">tabWidth</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
                <span style="color: #009900;">&#40;</span>feedbackTab.<span style="color: #660066;">speed</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</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: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I hope someone has fun with this. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/08/jquery-animated-feedback-tab-thingy/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Mid 30s crisis birthday jump!</title>
		<link>http://wpaoli.building58.com/2009/08/mid-30s-crisis-birthday-jump/</link>
		<comments>http://wpaoli.building58.com/2009/08/mid-30s-crisis-birthday-jump/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 22:46:25 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[Mounting Biking]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=122</guid>
		<description><![CDATA[When I first rediscovered Shells again last year, I was amazed at how it had evolved. The gaps between the jumps looked basically undoable. 20-30 foot gaps with very unforgiving consequences.
The idea of actually hitting one of these gaps became almost a silly obsession in my mind. Every visit to the spot with my co-worker [...]]]></description>
			<content:encoded><![CDATA[<p>When I first rediscovered Shells again last year, I was amazed at how it had evolved. The gaps between the jumps looked basically undoable. 20-30 foot gaps with very unforgiving consequences.<br />
<a href="http://wpaoli.building58.com/wp-content/uploads/2009/08/gap-plan.jpg"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/08/gap-plan.jpg" alt="gap-plan" title="gap-plan" width="580" height="316" class="alignright size-full wp-image-123" /></a>The idea of actually hitting one of these gaps became almost a silly obsession in my mind. Every visit to the spot with my co-worker Zane, I would look at it thinking &#8217;someday ill have the balls to hit that&#8217;.<br />
<span id="more-122"></span><br />
<a href="http://wpaoli.building58.com/wp-content/uploads/2009/08/the-appraoch.jpg"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/08/the-appraoch-300x256.jpg" alt="the-appraoch" title="the-appraoch" width="300" height="256" class="alignright float-right size-medium wp-image-124" /></a>After almost an entire year of lusting over the possibility of hitting this stupid jump, it was starting to seem like something I would never do. Mike G (this dude that goes there a lot), just did some very nice maintenance on the jumps, that combined with the fact that it is my 35th birthday, today was the day to just go for it. I felt great on my basic warm up of hitting the easy jumps, the wind was mellow, and I had no excuses. It might seem silly but hitting this jump was some sort of an accomplishment, and being my 35th birthday made it that much more symbolic (of what I&#8217;m not entirely sure). Check out the video:</p>
<p class="centered"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/jCnzcxj-xyE&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jCnzcxj-xyE&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/08/mid-30s-crisis-birthday-jump/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shredding the Peninsula</title>
		<link>http://wpaoli.building58.com/2009/07/shredding-the-peninsula/</link>
		<comments>http://wpaoli.building58.com/2009/07/shredding-the-peninsula/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:30:26 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[Mounting Biking]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=91</guid>
		<description><![CDATA[
My work badge, with mini map of Waterdog Lake

For people that live/work in the San Francisco bay area, specifically the peninsula between San Carlos and San Mateo, the options for mountain biking/dirt jumping are really damn good considering the proximity of the various spots within this small area. I am able to access each of [...]]]></description>
			<content:encoded><![CDATA[<div  class="float-right clearfix">
<a href="http://wpaoli.building58.com/wp-content/uploads/2009/07/workbadge.jpg"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/07/workbadge.jpg" alt="my work badge" title="work badge" /><span class="caption">My work badge, <br />with mini map of Waterdog Lake</span></a>
</div>
<p>For people that live/work in the San Francisco bay area, specifically the peninsula between San Carlos and San Mateo, the options for mountain biking/dirt jumping are really damn good considering the proximity of the various spots within this small area. I am able to access each of these 3 amazingly awesome spots within 5-10 mins of where I sit and for this I am very grateful. <em>There are actually several more than these, but I am focusing on the ones I can literally ride to on a lunch break.</em><br />
<span id="more-91"></span></p>
<h2>Spot one: Shells</h2>
<p>This place has been around forever and is a long standing part of the Foster City community. It lives on private property with mysterious owners that don&#8217;t seem to mind that kids of all ages are building an alien landscape out of the shoreline for their thrills and desires. </p>
<div  class="float-right">
<a href="http://www.yelp.com/biz_photos/SY0UjHJDckc9XcXhqf4Oqg?select=LkrgNYd2TG-aPibpX0ab2g"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/07/shells-300x225.jpg" alt="Photo Credit: Gideon K." title="shells" width="300" height="225" class="size-medium wp-image-95" /><span class="caption">Photo Credit: Gideon K.</span></a>
</div>
<p>It used to be easy and fun, good for any kid with a BMX bike, but over the years its progressed along with the sport of dirt jumping, and now the place is pretty damn extreme. I would say 90% of the jumps there now have serious consequences upon failure and are for experts only. That said, the other 10% that remains is still fun and worth going out there for. I have taken my 5 and 8 year old kids out there and they are able to keep themselves entertained for hours rolling through the berms and hitting the smaller rollers. I go there just about everyday since its a 5 min ride from where I sit. The fresh air and the shell beach alone is a great reason to check out this spot. </p>
<h2>Spot two: DMC aka Carlmont</h2>
<p>Another classic spot, 20 min ride from where I sit, Carlmont, like shells had humble beginnings and now has grown with the sport to become a gnarley jumping/downhill spot. This is also private property that has been manipulated by the hard work of mtn bikers over the years. Rumors about the actual owners and how they let this go on are plentiful and varied.</p>
<div  class="float-left">
<a href="http://www.pinkbike.com/photo/3526812/"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/07/carlmont.jpg" alt="Jumping Carlmont" title="carlmont" class="size-medium wp-image-95" /><span class="caption">Photo Credit: J. Brantley</span></a>
</div>
<p>Also like shells there are about 2 or 3 out of the dozens of jumps available that I will even attempt. BMXers wont touch this place. You will see big suspension bikes doing ridiculous shit that seems impossible until you see some fool fly over a 30 foot gap with ease. There is an awesome jump here that is so much fun even for mortals like me and keeps me coming back again and again. You drop down a steep trail that is about 20 feet and then you immediately are shot up a steep kicker of a jump. The great thing about it is that there is no gap to clear, meaning no major consequences if you mess up. Another great spot even if just for the nature, which brings me to the 3rd spot I want to talk about that is just right up over the next canyon from Carlmont, Waterdog lake.</p>
<h2>Spot three: Waterdog Lake</h2>
<p>Waterdog is actually trail system in a nature preserve maintained by the city of Belmont. There are miles of cross country single track and it&#8217;s amazingly fun and vast for a park seemingly tucked in the middle of suburbia.</p>
<div  class="float-right">
<a href="http://wpaoli.building58.com/wp-content/uploads/2009/07/photo_060409_001.jpg"><img src="http://wpaoli.building58.com/wp-content/uploads/2009/07/photo_060409_001.jpg" alt="Waterdog: Elevator Trail" title="waterdog" width="300" height="225" class="size-medium wp-image-95" /><span class="caption">Photo Credit: my palm centro</span></a>
</div>
<p> A group of mountain bikers got together years ago and got permission from the city to improve and build trails in this park, so when you come across hikers and joggers I notice a different level of respect instead of the &#8217;slow down&#8217; or looks of disdain you get at other parks. I am proud of the fact that I am able to park my car, jam to the top, and fly down getting in a good amount of fun fast downhill in about 30 mins. Makes it a perfect before or after work destination. </p>
<p>If you are ever in the mood for a lunch time ride, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/07/shredding-the-peninsula/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ZOOM is good for print.css</title>
		<link>http://wpaoli.building58.com/2009/07/zoom-is-good-for-printcss/</link>
		<comments>http://wpaoli.building58.com/2009/07/zoom-is-good-for-printcss/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 00:11:16 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=73</guid>
		<description><![CDATA[Part 2 in my series on print.css
While one of your co-workers is in the middle of an annoying IE6 bug, say &#8220;zoom one&#8221; to them and chances are they will laugh (or maybe cry). The proprietary IE css &#8216;zoom&#8216; property has its roots in accessibility and well intentioned functionality however now it is mostly used [...]]]></description>
			<content:encoded><![CDATA[<p><em>Part 2 in my series on print.css</em></p>
<p>While one of your co-workers is in the middle of an annoying IE6 bug, say &#8220;zoom one&#8221; to them and chances are they will laugh (or maybe cry). The proprietary IE css &#8216;<a href="http://msdn.microsoft.com/en-us/library/ms531189(VS.85).aspx">zoom</a>&#8216; property has its roots in accessibility and well intentioned functionality however now it is mostly used as a IE6 hack to give an element the &#8216;<a href="http://www.positioniseverything.net/articles/haslayout.html">has-layout</a>&#8216; property.<br />
It&#8217;s usually used in a moment of complete desperation at the last minute when nothing else is working; <em>&#8220;dude&#8230;try  {zoom:1}&#8230;. holy shit that worked!&#8221;</em>.<br />
<span id="more-73"></span></p>
<h2>Is this what zoom is actually good for?</h2>
<p>Recently in my travels along creating a print style sheet for our entire site, I think I may have found another more legit and helpful use of zoom. I found that my pages were printing fine by default in firefox and safari, then in IE everything was big, fugly and going outside the margins of the page. Here is something for your toolbox if you ever need it. In either your head tag, <em>(or external print.css style sheet)</em> try:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;style type=&quot;text/css&quot; media=&quot;print&quot;&gt;
body {
zoom:75%; /*or whatever percentage you need, play around with this number*/
}
&lt;/style&gt;</pre></div></div>

<p>Only IE understands zoom, and all other browsers ignore it so, when you goto print from IE the page will actually be reduced nicely to fit by 75%.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/07/zoom-is-good-for-printcss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print CSS and Logos</title>
		<link>http://wpaoli.building58.com/2009/06/print-css-and-logos/</link>
		<comments>http://wpaoli.building58.com/2009/06/print-css-and-logos/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 04:18:38 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=41</guid>
		<description><![CDATA[Most of us now use css background images to display our logos so that we still have the text in our html source for SEO/Accessibility reasons. Usually works out just fine, but one day a very shocked and surprised QA person was waving paper in front of my face going &#8220;AHH! The logo is missing! [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us now use css background images to display our logos so that we still have the text in our html source for SEO/Accessibility reasons. Usually works out just fine, but one day a very shocked and surprised QA person was waving paper in front of my face going <em>&#8220;AHH! The logo is missing! The LOGO IS MISSING!&#8221;</em>. I&#8217;m all like <em>&#8220;background images do NOT print by default. Whatev&#8230;&#8221;</em>. Then Someone else was like,<em> &#8216;ewwww our logo doesn&#8217;t print?&#8217;</em>. As a crowd started to form around the upheaval at my desk I dramatically crumpled the paper and said <em>&#8216;Ill fix it, Ill fix it! GOSH&#8230;&#8217;</em><br />
<span id="more-41"></span><br />
Since I didn&#8217;t want to ditch the CSS purist technique completely I decided to combine the two methods.  </p>
<p><em style="font-size:80%">(The main reason I actually wanted to keep this technique wasn&#8217;t because of purity as much as the fact that I was using a transparent png which is MUCH easier to deal as a bg image with when making it work in IE6)</em></p>
<p>Usually we start with html that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;logo-wrap&quot;&gt;
	&lt;a href=&quot;/index.html&quot;&gt;Website Name&lt;/a&gt;
&lt;/div&gt;</pre></div></div>

<p>With the background image attached to the #logo-wrap div and the text-indent set to like -99999px.</p>
<p>So, I decided to just add the img to this html, and call in the exact same image, then hide it with the screen css and show it in the print css.</p>
<p>The img added to the html:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;logo-wrap&quot;&gt;
	&lt;a href=&quot;/index.html&quot;&gt;Website Name
             &lt;img src=&quot;images/logo.gif&quot; alt=&quot;Website Name&quot; /&gt;
        &lt;/a&gt;
&lt;/div&gt;</pre></div></div>

<p>css for the screen:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
	        #logo-wrap {
	            background: url(images/logo.gif) no-repeat 0 0;
	            width: 300px;
	            height: 250px;
	            text-indent: -99999px;
	        }
&nbsp;
	        #logo-wrap img {
	                display:none;               
	        }   
&lt;/style&gt;</pre></div></div>

<p>css for the print:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;style type=&quot;text/css&quot; media=&quot;print&quot;&gt;
	        #logo-wrap {
	            background: none;
	        }
&nbsp;
	        #logo-wrap img {
	                display:block;               
	        }   
&lt;/style&gt;</pre></div></div>

<p>Very simple but it worked. So, why load an image if it never gets used except for those rare times when some tree hater from the 90s has to print the website? I agree, pretty stupid. But people are happy now when they print. JIRA Closed. I have a job. I am a sell out. I make shit work, shuddup. </p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/06/print-css-and-logos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why look, I have a blog&#8230;</title>
		<link>http://wpaoli.building58.com/2009/05/why-have-a-blog/</link>
		<comments>http://wpaoli.building58.com/2009/05/why-have-a-blog/#comments</comments>
		<pubDate>Tue, 19 May 2009 05:56:31 +0000</pubDate>
		<dc:creator>WillyP</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://wpaoli.building58.com/?p=16</guid>
		<description><![CDATA[Hey here I am, another web developer with a blog! My own place to discuss the exciting topics we web devs love to argue about endlessly on our quest to make better websites for people to use.  Exciting and engaging topics such as:

XHTML Strict or Transitional or HTML4 (to get ready for 5).
Is W3C validation [...]]]></description>
			<content:encoded><![CDATA[<p>Hey here I am, another web developer with a blog! My own place to discuss the exciting topics we web devs love to argue about endlessly on our quest to make better websites for people to use.  Exciting and engaging topics such as:</p>
<ul>
<li><a href="http://expressionengine.com/forums/viewthread/112226/">XHTML Strict or Transitional or HTML4 (to get ready for 5)</a>.</li>
<li><a href="http://www.leemunroe.com/how-important-is-valid-html-web-standards/">Is W3C validation really THAT critical?</a></li>
<li><a href="http://www.positioniseverything.net/easyclearing.html">CSS layout floats?</a></li>
<li><a href="http://jqueryvsmootools.com/">jquery Vrs mootools</a> (cool article)</li>
<li><a href="http://stackoverflow.com/questions/277414/how-does-javafx-compare-to-flash-and-flex">Flash, flex, JavaFX</a></li>
<li><a href="http://expressionengine.com/">Expression Engine</a> or <a href="http://wordpress.org">WordPress</a> or <a href="http://drupal.org/">Drupal</a>?</li>
<li><a href="http://wiki.novemberborn.net/sifr/">SifR</a> or the <a href="http://wiki.github.com/sorccu/cufon">latest annoying text header replacement technique</a>?</li>
<li><a href="http://www.smashingmagazine.com/2008/07/01/should-links-open-in-new-windows/">Open external links in new window?</a></li>
<li><a href="http://community.zikula.org/module-Forum-viewtopic-topic-55349.htm">Graceful degradation and progressive enhancement or screw no-js people? </a></li>
<li><a href="http://developer.apple.com/internet/webcontent/objectdetection.html">Browser detection, object detection or feature detection?</a></li>
</ul>
<p>Do I care&#8230;really? Do I have opinions about these topics? Yup, but I usually won&#8217;t admit it. There are obviously enough places out there to discuss these matters, so if nothing else this blog is here to show the world that William Paoli truly is passionate about UI design, with expert knowledge of css/html/javascript, BA in computer science (or equivalent experience), basic Photoshop skills, and a team player with the desire to learn new things&#8230;Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpaoli.building58.com/2009/05/why-have-a-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
