<?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>blog.paulgueller.com &#187; JavaScript</title>
	<atom:link href="http://blog.paulgueller.com/category/web/javascript-web/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.paulgueller.com</link>
	<description>Web Development Resources</description>
	<lastBuildDate>Mon, 21 Sep 2009 14:19:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Toggle Text Field Values with jQuery</title>
		<link>http://blog.paulgueller.com/2009/09/18/toggle-text-field-values-with-jquery/</link>
		<comments>http://blog.paulgueller.com/2009/09/18/toggle-text-field-values-with-jquery/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:00:09 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=176</guid>
		<description><![CDATA[I saw this post on the CSS Tricks Snippet Feed which addresses a commonly desired form behavior: to provide default text in an INPUT element that disappears when the user enters that field. The example provided works, but I have a couple issues with it: Uses inline JavaScript, and must be reapplied to each element [...]]]></description>
			<content:encoded><![CDATA[<p>I saw <a title="Clear Field on Focus" href="http://css-tricks.com/snippets/javascript/clear-field-on-focus/">this post</a> on the <a title="CSS Tricks Snippet Feed | Yahoo! Pipes" href="http://feeds.feedburner.com/CSS-TricksSnippets">CSS Tricks Snippet Feed</a> which addresses a commonly desired form behavior: to provide default text in an <kbd>INPUT</kbd> element that disappears when the user enters that field. The example provided works, but I have a couple issues with it:</p>
<ol>
<li>Uses inline JavaScript, and must be reapplied to each element affected</li>
<li>Repeats the contents of the <kbd>value</kbd> attribute</li>
<li>The default text is not replaced if the user exits the field without entering new data</li>
</ol>
<p>So I created a possible solution, using jQuery:</p>
<h3>HTML</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><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;text&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Place default text here&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></td></tr></table></div>

<h3>JavaScript</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<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;">'input[type=&quot;text&quot;]'</span> <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'title'</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
      .<span style="color: #000066;">focus</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> $<span style="color: #009900;">&#40;</span><span style="color: #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;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">' '</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #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>
<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p></p>
<p>This script first iterates over each of the text input to assign a semantic text attribute, helpful not only in storing the default value, but also providing a tool-tip for reference as the user interacts with the page. It then assigns behaviors for both the <kbd>onfocus</kbd> and <kbd>onblur</kbd> events, eliminating the need to respecify data for comparison. The script is cleanly separated from the markup and, using jQuery, additional specifications may be made so as to only affect children of a particular <kbd>FIELDSET</kbd> or only those that possess a certain class.</p>
<p>I hope you find this snippet useful, and feel free to comment if you have additional information to share.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2009/09/18/toggle-text-field-values-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: Create a jQuery Plugin</title>
		<link>http://blog.paulgueller.com/2009/02/19/howto-create-a-jquery-plugin/</link>
		<comments>http://blog.paulgueller.com/2009/02/19/howto-create-a-jquery-plugin/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 19:55:53 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[screencast]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=101</guid>
		<description><![CDATA[Jeffrey Way provides a step-by-step screencast, accompanied by source code and plenty of documentation in the post titled You Still Can’t Create a jQuery Plugin? &#8211; NETTUTS.]]></description>
			<content:encoded><![CDATA[<p>Jeffrey Way provides a step-by-step screencast, accompanied by source code and plenty of documentation in the post titled <a href="http://net.tutsplus.com/videos/screencasts/you-still-cant-create-a-jquery-plugin/">You Still Can’t Create a jQuery Plugin? &#8211; NETTUTS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2009/02/19/howto-create-a-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Innovative Layouts and Content Transitions with JavaScript</title>
		<link>http://blog.paulgueller.com/2009/02/07/innovative-layouts-and-content-transitions-with-javascript/</link>
		<comments>http://blog.paulgueller.com/2009/02/07/innovative-layouts-and-content-transitions-with-javascript/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 20:46:17 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[noupe]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=52</guid>
		<description><![CDATA[I started following @jquery on Twitter sometime ago, and they have provided a lot of great links and information. One interesting link is to an article about methods for presenting information and creating systems to enhance user experience: Delivering informative structure is the primary task an interactive user interface should be able to cope with. [...]]]></description>
			<content:encoded><![CDATA[<p>I started following <a title="News &amp; updates from the jQuery team." href="http://twitter.com/jquery">@jquery</a> on Twitter sometime ago, and they have provided a lot of great links and information.</p>
<p>One interesting link is to an article about methods for presenting information and creating systems to enhance user experience:</p>
<blockquote><p>
Delivering informative structure is the primary task an interactive user interface should be able to cope with. The more intuitive layout structure is designed, the better users can understand the content.
</p></blockquote>
<p><a title="10 Smart Javascript Techniques For Manipulating Content" href="http://www.noupe.com/javascript/10-smart-javascript-techniques-for-manipulating-content.html">Read the full article on Noupe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2009/02/07/innovative-layouts-and-content-transitions-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Examples of jQuery In Action</title>
		<link>http://blog.paulgueller.com/2009/01/28/examples-of-jquery-in-action/</link>
		<comments>http://blog.paulgueller.com/2009/01/28/examples-of-jquery-in-action/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 20:41:28 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=86</guid>
		<description><![CDATA[The jQuery foundation has created a new site showcasing designs that Use jQuery. They currently have only about 30 samples organized by effect/function category, but they do accept submissions so show off that great interface or behavior that you&#8217;ve created!]]></description>
			<content:encoded><![CDATA[<p>The jQuery foundation has created a new site showcasing designs that <a href="http://usejquery.com/">Use jQuery</a>. They currently have only about 30 samples organized by effect/function category, but they do accept submissions so <a title="Submit your site" href="http://www.noupe.com/javascript/10-smart-javascript-techniques-for-manipulating-content.html">show off</a> that great interface or behavior that you&#8217;ve created!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2009/01/28/examples-of-jquery-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>25 Tips to Developing with jQuery</title>
		<link>http://blog.paulgueller.com/2009/01/18/25-tips-to-developing-with-jquery/</link>
		<comments>http://blog.paulgueller.com/2009/01/18/25-tips-to-developing-with-jquery/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 15:50:06 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=61</guid>
		<description><![CDATA[Jon Hobbs-Smith has compiled a list of 25 tips to making your jQuery-powered applications easier to script and faster loading.]]></description>
			<content:encoded><![CDATA[<p>Jon Hobbs-Smith from the UK web development firm <a title="Web Design by TVI" href="http://www.tvidesign.co.uk/">TVI Design</a> has compiled a <a title="25 Tips to Improve Your jQuery" href="http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx">list of 25 tips</a> to making your jQuery-powered applications easier to script and faster loading. While some of the items may be considered common knowledge (such as <code>return false;</code> for click events to prevent default behavior) the list provides excellent links and resources to people interested in using the <a title="jQuery" href="http://jquery.com/">Write Less, Do More JavaScript Library</a>.</p>
<p>Considering almost all the <a title="Update to v1.3.0" href="http://docs.jquery.com/Release:jQuery_1.3">recent updates</a> to the framework relate to improving speed, why not take fullest advantage of them in making your application as responsive as possible?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2009/01/18/25-tips-to-developing-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pushup Makes the Web Stronger</title>
		<link>http://blog.paulgueller.com/2008/12/19/pushup-makes-the-web-stronger/</link>
		<comments>http://blog.paulgueller.com/2008/12/19/pushup-makes-the-web-stronger/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 05:01:36 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[nick stakenburg]]></category>
		<category><![CDATA[pushup]]></category>
		<category><![CDATA[standards compliance]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=38</guid>
		<description><![CDATA[Give your users a better web experience and move the web forward by helping users upgrade their outdated browsers A subtle upgrade link is shown when people visit your website using an outdated version of Internet Explorer, Firefox, Safari or Opera.]]></description>
			<content:encoded><![CDATA[<p>Every web developer that I know is <a title="IE Voodoo Doll Tutorial" href="http://chisa.deviantart.com/art/tutorial-IE-voodoo-doll-65352093">sick and tired</a> of making compromises and hacks to accommodate <a title="Petition to &quot;Make Internet Explorer Standards Compliant&quot;" href="http://www.petitiononline.com/IE7STAN/petition.html">Internet Explorer 6</a> and other browsers that are not <a title="About the World Wide Web Consortium (W3C)" href="http://www.w3.org/Consortium/Overview.html">standards compliant</a>. While <a title="Will we ever be able to fully utilize CSS2?" href="http://www.css3.info/graceful-degradation/">graceful degradation</a> (or <a title="Two sides of the same coin" href="http://accessites.org/site/2007/02/graceful-degradation-progressive-enhancement/">progressive enhancement</a>, depending on which philosophy you subscribe to) will continue to be a par for the course for the forseeable future, it would be great if we could fully take advantage of the available technologies and minimize crosss-browser tesing costs in our project budgets.</p>
<p>To this goal, <a title="Nick Stakenburg : Web Developer and Illustrator" href="http://www.nickstakenburg.com/">Nick Stakenburg</a> released a script that gently alerts the user that their browser could use an upgrade. <a title="Give your users a better web experience" href="http://www.pushuptheweb.com/">Pushup</a> detects the version of the client and briefly flashes a notice with a link to download an update. The entire package is fairly lightweight (only 11kb, zipped) and includes the images, sylesheets and JavaScript files to run. Implementation and customization information is provided on the download site, in addition to ports of the function for <a title="Psychcf dojox.pushup" href="http://psychcf.dojotoolkit.org/pushup/">dojo</a> and <a title="Uses jQuery fade effect instead of prototype's" href="http://stuartloxton.com/jquery-pushup/">jQuery</a>.</p>
<p>This doesn&#8217;t really help users whose IT departments <a title="WHY?!?!" href="http://www.itedge.net/blog/2006/09/18/prevent-automatic-update-to-internet-explorer-7-ie7/">prohibit them from updating</a>, but if it helps those who are unaware that there is a better web experience to be had then it is worthy of praise and support.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2008/12/19/pushup-makes-the-web-stronger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sIFR + jQuery = Custom Typography Without Image Replacement</title>
		<link>http://blog.paulgueller.com/2008/12/16/sifr-jquery-custom-typography-without-image-replacement/</link>
		<comments>http://blog.paulgueller.com/2008/12/16/sifr-jquery-custom-typography-without-image-replacement/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 22:41:56 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[sift]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=36</guid>
		<description><![CDATA[Sick of reusing the same few "web-safe" fonts? Tired of resorting to turning those headlines into images only to revise them whenever there's a copy change? Utilize the flexibility of sIFR with the power of jQuery to insert dynamic vector typefaces into your layout with a lightweight plug-in.]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard of it already, <a title="Scalable Inman Flash Replacement" href="http://novemberborn.net/sifr">sIFR</a> lets you appease all those designers by integrating custom fonts onto your standards-compliant web page without turning them into images. On its own, it&#8217;s not a small or straightforward undertaking, requiring a number of additional CSS and JavaScript files to function. However, the recent release of the <a title="Replace text in a web page dynamically through library extension" href="http://jquery.thewikies.com/sifr/">sIFR jQuery plug-in</a> should make it more accessible to developers:</p>
<blockquote><p>First, jQuery makes finding the item(s) that you want to replace as easy as using CSS. Then, the jQuery sIFR Plugin does all the work of figuring out the text, files, sizes, colors, and any other configurations needed for the conversion. The jQuery sIFR plugin is fully configurable and can choose how little or how much you want to customize the display of the sIFRed text. Finally, the jQuery Flash Plugin does a most excellent job of embedding the sIFR flash into your web page. After all is said and done, you should have beautiful sIFR replaced text with consistent behavior across all major browsers.</p></blockquote>
<p>All the resources are available for download from the <a title="jQuery Sifr Plugin by Jonathan Neal " href="http://jquery.thewikies.com/sifr/">developer&#8217;s site</a>, as well a simple API and usage examples for easy customization.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2008/12/16/sifr-jquery-custom-typography-without-image-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Evolution of Sizzle</title>
		<link>http://blog.paulgueller.com/2008/12/12/the-evolution-of-sizzle/</link>
		<comments>http://blog.paulgueller.com/2008/12/12/the-evolution-of-sizzle/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 19:58:15 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[john resig]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sizzle]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/?p=29</guid>
		<description><![CDATA[jQuery founder discusses possibilities of CSS-based selector engine to extend major JavaScript libraries]]></description>
			<content:encoded><![CDATA[<p>Among the many interesting things discussed in the <a title="Interview with John Resig, jQuery Creator" href="http://www.sitepoint.com/article/interview-john-resig/">interview</a> with Sitepoint, John Resig <a title="First reference on Ajaxian" href="http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine">again</a> brought up a project titled <a title="A sizzlin' hot selector engine." href="http://github.com/jeresig/sizzle/tree/master">Sizzle</a>. No, he&#8217;s not talking about adding <strong>POW BANG SHAZAM</strong> to our web layouts; it&#8217;s an initiative to create standardized and easily-implemented CSS-based selectors for JavaScript. Aside from its lightweight and extensible nature, jQuery&#8217;s ability to easily assign behaviors and attributes to custom-created arrays of elements without much hassle is one of its most appealing features. Using a similar scheme for other libraries, frameworks or even in stand-alone cases would not only simplify programming (goodbye <code>document.getElementsByTagName</code> &#8220;for&#8221; loops!) but would improve the language as a whole by making scripts more readable and accessible.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2008/12/12/the-evolution-of-sizzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery for DHTML Drop-Down Menus</title>
		<link>http://blog.paulgueller.com/2008/04/17/using-jquery-for-dhtml-drop-down-menus/</link>
		<comments>http://blog.paulgueller.com/2008/04/17/using-jquery-for-dhtml-drop-down-menus/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 14:54:38 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[dhtml]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.paulgueller.com/2008/04/17/using-jquery-for-dhtml-drop-down-menus/</guid>
		<description><![CDATA[You may have heard of the Suckerfish Dropdowns featured on A List Apart (which use CSS and JavaScript along with valid HTML to create vertical or horizontal &#8220;drop-down&#8221; menus) and the the extended revised version Son of Suckerfish, but if you&#8217;re already using the jQuery library on your site the code to mimic the :hover [...]]]></description>
			<content:encoded><![CDATA[<p>You may have heard of the <a href="http://www.alistapart.com/articles/dropdowns/">Suckerfish Dropdowns</a> featured on A List Apart (which use CSS and JavaScript along with valid HTML to create vertical or horizontal &#8220;drop-down&#8221; menus) and the the extended revised version <a href="http://www.htmldog.com/articles/suckerfish/">Son of Suckerfish</a>, but if you&#8217;re already using the <a href="http://jquery.com/">jQuery</a> library on your site the code to mimic the <kbd>:hover</kbd> pseudo-class gets even simpler.</p>
<p>Instead of:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">sfHover <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: #003366; font-weight: bold;">var</span> sfEls <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;nav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;LI&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>sfels .<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#123;</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;</span>
		sfEls<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">onmouseover</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span><span style="color: #339933;">+=</span><span style="color: #3366CC;">&quot; sfhover&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		sfEls<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">onmouseout</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span><span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; sfhover<span style="color: #000099; font-weight: bold;">\\</span>b&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">attachEvent</span><span style="color: #009900;">&#41;</span> window.<span style="color: #660066;">attachEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;onload&quot;</span><span style="color: #339933;">,</span> sfHover<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>sfels<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>You only need:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#nav li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sfhover'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//mouseover</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sfhover'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//mouseout</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Such is the beauty of using css-style selectors to build an array of affected elements. Of course, you must make sure the code is wrapped in <kbd>$(document).ready(function(){…});</kbd>, but there is no need to modify the <em>window.onload</em> event in this example. Otherwise, refer to the code provided in the above examples to get your markup and formatting styles in place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulgueller.com/2008/04/17/using-jquery-for-dhtml-drop-down-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
