<?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>Wes Ray &#187; jQuery</title>
	<atom:link href="http://www.wessray.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wessray.com</link>
	<description>Just another idiot with a blog</description>
	<lastBuildDate>Fri, 12 Nov 2010 09:21:28 +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>Wufoo Style jQuery form Tutorial with focus / active state</title>
		<link>http://www.wessray.com/jquery/wufoo-style-jquery-form-focus-active-state/</link>
		<comments>http://www.wessray.com/jquery/wufoo-style-jquery-form-focus-active-state/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 00:56:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wessray.com/?p=80</guid>
		<description><![CDATA[
		
		
		
		So you like how Wufoo looks do you?  Well you can make your form look just like their&#8217;s.  I have a DEMO you can check out to test the functionality of what the hell I&#8217;m talking about in this tutorial.   But I would much rather show you in code than ramble [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/jquery/wufoo-style-jquery-form-focus-active-state/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Wufoo+Style+jQuery+form+Tutorial+with+focus+%2F+active+state";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>So you like how Wufoo looks do you?  Well you can make your form look just like their&#8217;s.  I have a <a href="/labs/wufooish.php">DEMO</a> you can check out to test the functionality of what the hell I&#8217;m talking about in this tutorial.   But I would much rather show you in code than ramble about something that doesn&#8217;t need much explaining.  SO, here is the breakdown of this tutorial on how to focus a form field state with jQuery . GO!<br />
<h2>jQuery</h2>
<p>This is the <a href="http://www.jquery.com" target="_blank">jQuery</a>, which is a javascript framework that makes coding this crap SO much easier.  and it must be included on the page for this to work.  You can view the source of the <a href="view-source:http://www.wessray.com/labs/wufooish.php">DEMO</a> and get an idea about exactly what is going on.  Its commented for your understanding.</p>
<pre class="brush: jscript;">
	//Wesified.
		$(document).ready(function() {
	//On input focus (tabbed or clicked)..it will..
			$(&quot;input,textarea,select&quot;).focus(function () {
	//grab the parent nested LI of that input and add the bg color
		        	$(this).parents('li').css('background-color','#FFFFDD');
				}).blur(function() {
	//Then get rid of it
			$(this).parents('li').css('background-color','#FFFFFF');
	});
});
</pre>
<h2>HTML</h2>
<p>So this is the structure of the form. nuff&#8217; said</p>
<pre class="brush: xml;">
&lt;form id=&quot;contact_form&quot; class=&quot;contact_form&quot;&gt;
  &lt;div&gt;
    &lt;ul&gt;
      &lt;li&gt; &lt;span class=&quot;left_half&quot;&gt;
        &lt;label for=&quot;first_name&quot;&gt;First Name &lt;span class=&quot;required&quot;&gt; *&lt;/span&gt;&lt;/label&gt;
        &lt;input class=&quot;required&quot; type='text' name='first_name' value=''&gt;
        &lt;/span&gt; &lt;span class=&quot;right_half&quot;&gt;
        &lt;label for=&quot;last_name&quot;&gt;Last Name &lt;span class=&quot;required&quot;&gt; *&lt;/span&gt;&lt;/label&gt;
        &lt;input class=&quot;required&quot; type='text' name='last_name' value=''&gt;
        &lt;/span&gt; &lt;/li&gt;
      &lt;li&gt; &lt;span class=&quot;left_half&quot;&gt;
        &lt;label for=&quot;other_stuff&quot;&gt;Other Stuff&lt;span class=&quot;required&quot;&gt; *&lt;/span&gt;&lt;/label&gt;
        &lt;input class=&quot;required&quot; type='text' name='other_stuff' value=''&gt;
        &lt;/span&gt; &lt;span class=&quot;right_half&quot;&gt;
        &lt;label for=&quot;expand_more&quot;&gt;Expand More &lt;span class=&quot;required&quot;&gt; *&lt;/span&gt;&lt;/label&gt;
        &lt;input class=&quot;required&quot; type='text' name='expand_mores' value=''&gt;
        &lt;/span&gt; &lt;/li&gt;
      &lt;li&gt; &lt;span class=&quot;full&quot;&gt;
        &lt;label for=&quot;company&quot;&gt;Company &lt;span class=&quot;required&quot;&gt; *&lt;/span&gt;&lt;/label&gt;
        &lt;input class=&quot;required&quot; type='text' name='company' value=''&gt;
        &lt;/span&gt; &lt;/li&gt;
      &lt;li class=&quot;button&quot;&gt;
        &lt;button type=&quot;submit&quot;&gt;Submit Form&lt;/button&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/form&gt;
</pre>
<h2>CSS</h2>
<p>This is what makes it look badass.</p>
<pre class="brush: css;">
form ul {
	list-style-type:none;
	width: 450px;
}
form li {
	clear:both;
	display:block;
	margin:0;
	padding:6px 9px 9px 9px;
	font-size: small;
	width:500px;
	overflow: hidden;
}
form li input, textarea {
	border-color:#7C7C7C #C3C3C3 #DDDDDD;
	border-style:solid;
	border-width:1px;
	color:#333333;
	margin:0;
	padding:2px 0;
	font-family:Tahoma, Arial, sans-serif;
	width:100%;
}
form li label {
	border:medium none;
	color:#222222;
	display:block;
	font-size:95%;
	font-weight:bold;
	line-height:150%;
	margin:0;
	padding:0 0 3px;
	font-family:Tahoma, Arial, sans-serif;
}
form li span label.sub {
	padding-bottom:0px;
	font-weight:normal;
}
form li label, form li span label {
	clear:both;
	color:#444444;
	display:block;
	font-size:85%;
	margin:0;
	padding-top:6px;
}
.left_half {
	float:left;
	width:250px;
}
.right_half {
	float:right;
	width:230px;
}
.full {
	width:460px;
}
li.left_half {
	clear:left !important;
	float:left;
}
form li:hover {
	background-color:#FFFFDD;
}
form li.section {
	border-top:1px dotted #CCCCCC;
}
form li.button:hover {
	background-color:#FFFFFF;
}
label.error, span.required {
	color:#DF0000;
}
h2.form_title {
	border-bottom:1px dotted #CCCCCC;
	width:460px;
	margin-bottom:10px;
}
</pre>
<p>All in all, this is a pretty easy concept and I hope it helps a few of you out there.  If you have any questions just leave a comment and I&#8217;ll do my best to help you out.  </p>
<p>Cheers,</p>
<h1>Wes</h1>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/jquery/wufoo-style-jquery-form-focus-active-state/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Analytics Asynchronous Tracking, Finally!</title>
		<link>http://www.wessray.com/random/google-analytics-asynchronous-tracking-finally/</link>
		<comments>http://www.wessray.com/random/google-analytics-asynchronous-tracking-finally/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 21:30:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wessray.com/?p=75</guid>
		<description><![CDATA[
		
		
		
		Unlike the regular tracking code google analytics has, this snippet directly from google, this optimizes the way the page loads&#8230;SO if some of you have noticed on sites they get hung up and won&#8217;t load because its waiting on analytics loading in the header..Well fuck that.
here is the snipper


&#60;script type=&#34;text/javascript&#34;&#62;

  var _gaq = _gaq [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/random/google-analytics-asynchronous-tracking-finally/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Google+Analytics+Asynchronous+Tracking%2C+Finally%21";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Unlike the regular tracking code google analytics has, this snippet directly from google, this optimizes the way the page loads&#8230;SO if some of you have noticed on sites they get hung up and won&#8217;t load because its waiting on analytics loading in the header..Well fuck that.</p>
<p>here is the snipper</p>
<pre class="brush: jscript;">

&lt;script type=&quot;text/javascript&quot;&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

&lt;/script&gt;
</pre>
<p>It inserts the ga.js into the page, it specified the page&#8217;s web property ID and then calls _trackPageview to send the data back.  Just Replace the <strong>UA-XXXXX-X</strong> with your web property ID.  Visit <a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html" target="_blank">this</a> page from google for more details!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/random/google-analytics-asynchronous-tracking-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Accordion for Wordpress</title>
		<link>http://www.wessray.com/jquery/jquery-accordion-for-wordpress/</link>
		<comments>http://www.wessray.com/jquery/jquery-accordion-for-wordpress/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 23:43:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wessray.com/?p=39</guid>
		<description><![CDATA[
		
		
		
		So I was working on a site with a vertical navigation today and the previous developer working on it made the entire navigation static&#8230;.Well thats pretty much worthless for a CMS like Wordpress.  So I took it upon myself to create an accordion script for Wordpress (it can be used wtihout Wordpress just as [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.wessray.com/jquery/jquery-accordion-for-wordpress/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "jQuery+Accordion+for+Wordpress";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>So I was working on a site with a vertical navigation today and the previous developer working on it made the entire navigation static&#8230;.Well thats pretty much worthless for a CMS like Wordpress.  So I took it upon myself to create an accordion script for Wordpress (it can be used wtihout Wordpress just as easily).  I commented the code nicely and you can essentially paste this directly into wordpress and it will work.</p>
<p><strong>The File Structure is as follows</strong></p>
<pre class="brush: xml;">
&lt;ul&gt;
   &lt;li&gt;&lt;a href=&quot;http://link&quot;&gt;&lt;/a&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a href=&quot;http://subnavlink&quot;&gt;LINK&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
   &lt;/li&gt;
&lt;/ul&gt;
</pre>
<p><strong> The CSS You will need</strong></p>
<pre class="brush: css;">
#navigation ul li ul { display:none; }
#navigation .displayMe { display:block; }
</pre>
<p><strong> Now for the Javascript. This one is for all your Wordpress Developers who need a custom jQuery Accordion</strong></p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

$(document).ready(function() {	

//If its a page parent (based off wordpress), add the class &quot;displayMe&quot;
//This way the accordion will be opened up on the page you are on.
if ($('#navigation ul li').hasClass(&quot;current_page_parent&quot;)) {
	$('#navigation .current_page_parent ul').addClass(&quot;displayMe&quot;); }

//Hide the submenus
$('#navigation ul li ul').hide();

//Add a class to the parent li IF it has sub UL's
$(&quot;#navigation ul li:has(ul)&quot;).addClass(&quot;theDon&quot;);

//Da henchman
$(&quot;#navigation ul li ul li:has(a)&quot;).addClass(&quot;henchmen&quot;);

//Remove the link if it has a submenu
$('#navigation .theDon &gt; a').attr('href', '#');

//When you click it, toggle bitch.
$('#navigation ul li a').click(
function() {

//Onclick Remove the class dipslay me which is only display:block;
//This way they can close it if they click it or it will glitch
$(this).next().slideToggle('slow').removeClass(&quot;displayMe&quot;);

//return false so the # doenst move view to the top of the page
if ($(this).attr('href') == '#') { return false; }

//Close it all out
	});
 });

&lt;/script&gt;

&lt;div id=&quot;navigation&quot;&gt;
&lt;ul&gt;
&lt;?php wp_list_pages('title_li='); ?&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>Hope this jQuery Accordion with an emphasis for Wordpress helps!</p>
<p>Cheers,<br />
  -<strong style="font-size:14px;">Wes</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wessray.com/jquery/jquery-accordion-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

