<?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>FerretArmy: A Web Developer&#039;s Paradise &#187; jQuery</title>
	<atom:link href="http://www.ferretarmy.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ferretarmy.com</link>
	<description>Pushing the Web Forward, Since 2007</description>
	<lastBuildDate>Wed, 18 Jan 2012 15:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery Templating with .tmpl</title>
		<link>http://www.ferretarmy.com/2011/06/01/jquery-templating-with-tmpl/</link>
		<comments>http://www.ferretarmy.com/2011/06/01/jquery-templating-with-tmpl/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 00:27:23 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=544</guid>
		<description><![CDATA[A quick overview of the jQuery templating API.]]></description>
			<content:encoded><![CDATA[<p>Templating of web controls is a valuable technique that allows for code reuse. For example, if you have a repeated list of items with common attributes that need to be displayed on a web page, templating is a great solution. Templating can often be accomplished on the server side through controls such as ASP.NET repeaters. However, with the web of today, asynchronous programming is where it&#8217;s at. With AJAX data calls, you often get JSON objects back that must be turned into HTML and displayed on a web page.</p>
<p>There are a few ways of doing so &#8211; you could have an asynchronous call return an HTML fragment, for instance (done that). You could also embed placeholders in hidden HTML fragments on a page, and use a combination of jQuery&#8217;s clone/replace/append methods to push object data into them (done that too). However, there&#8217;s an even better technique available now, as a first-class citizen in the jQuery library &#8211; the <a href="http://api.jquery.com/jquery.tmpl/">.tmpl templating API</a>.</p>
<p>jQuery templating is a feature that&#8217;s currently in beta (though it is distributed with jQuery as of version 1.4.3), and is based upon an <a href="https://github.com/jquery/jquery-tmpl">existing templating plugin</a>. I&#8217;ve had the pleasure of using the jQuery templating API for a bit of time now, and I admit that it is by far the easiest, most robust templating solution I&#8217;ve found. There are template controls for repeaters (<a href="http://api.jquery.com/template-tag-each">{{each}}</a>), conditional statements (<a href="http://api.jquery.com/template-tag-if/">{{if}}</a> and <a href="http://api.jquery.com/template-tag-else">{{else}}</a>), templated HTML fragments (<a href="http://api.jquery.com/template-tag-html">{{html}}</a>), and wrapping (<a href="http://api.jquery.com/template-tag-wrap">{{wrap}}</a>). That&#8217;s a lot of functionality out of the box!</p>
<p>By far my favorite part of html templating, however, is the &lt;script type=&#8217;text/x-jquery-tmpl&#8217;&gt;&lt;/script&gt; tagging that you can wrap around your template fragments. One thing I&#8217;ve disliked with templating is that you have to embed potentially malformed HTML into your page &#8211; for instance, you might end up having to template id attributes. Malformed html is not the worst thing in the world, especially in hidden fields, but it certainly doesn&#8217;t help with search engine rankings and such. Having a way of clearly saying &#8220;I&#8217;m a template fragment&#8221; is a great thing, both for search engines and general maintainability.</p>
<p>If you haven&#8217;t gotten a chance to take a look at jQuery templating, now is certainly a great time to do so. It comes for free with jQuery, and it&#8217;s a fast, easy, and robust solution for templating needs.</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 116px; width: 1px; height: 1px; overflow: hidden;"><code>text/x-jquery-tmpl</code></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2011/06/01/jquery-templating-with-tmpl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending jQuery Selectors: &#8216;between&#8217;</title>
		<link>http://www.ferretarmy.com/2010/05/10/extending-jquery-selectors-between/</link>
		<comments>http://www.ferretarmy.com/2010/05/10/extending-jquery-selectors-between/#comments</comments>
		<pubDate>Mon, 10 May 2010 20:23:52 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[extending jQuery]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=516</guid>
		<description><![CDATA[There are a ton of jQuery selectors to get at just about any data imaginable on a page. Between actual selectors (such as ID and attribute selectors) and pseudo-selectors (such as :first and :checked), the bulk of HTML element selection is trivial. There are, however, a few selectors I&#8217;ve had a need for but aren&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>There are a ton of jQuery selectors to get at just about any data imaginable on a page. Between actual selectors (such as ID and attribute selectors) and pseudo-selectors (such as :first and :checked), the bulk of HTML element selection is trivial. There are, however, a few selectors I&#8217;ve had a need for but aren&#8217;t in jQuery currently &#8211; for instance, there is a <a href="http://api.jquery.com/next-adjacent-Selector/">next adjacent selector</a>, but there is no analogous &#8216;previous adjacent&#8217; selector baked in. How does one get around this? Let&#8217;s find out, after the jump.</p>
<p><span id="more-516"></span></p>
<p>There is a solution, of course &#8211; just like almost every part of jQuery, the <a href="http://sizzlejs.com/">Sizzle  selector engine</a> is extensible. That&#8217;s right &#8211; you can implement your own selectors that you can then use just like native selectors (big props to Ben Nadel for <a href="http://www.bennadel.com/blog/1457-How-To-Build-A-Custom-jQuery-Selector.htm">demonstrating this technique</a>). One of my first needs in this realm was to create a &#8216;between&#8217; selector &#8211; give me all the elements &#8216;between&#8217; selectors for element A and element B. Here&#8217;s an example of what we want the syntax to look like:</p>
<pre style="padding-left: 30px;">var rowsBetween = $('tr:between(tr:contains(Start), tr:contains(End))');
</pre>
<p>Given the selector above, we would expect it to return the following table rows:</p>
<p><a href="http://www.ferretarmy.com/wp-content/uploads/2010/05/capRows.png"><img class="alignnone size-full wp-image-517" title="Rows To Capture" src="http://www.ferretarmy.com/wp-content/uploads/2010/05/capRows.png" alt="" width="398" height="178" /></a></p>
<p>In order to implement this selector, we&#8217;re going to make a few assumptions in order to get it to work. First, we&#8217;re going to assume that both the inside selectors resolve to a single element (actually, they can resolve to any number of elements, we will just use only the first match). Next, we are going to assume that the first element actually occurs before the last element. These assumptions obviously make for a buggy implementation of a real selector, but they are perfectly acceptable for a user-driven project.<br />
So, down to it. The first thing we are going to do is setup the jQuery selector engine extension method:</p>
<pre>$.expr[':'].between = function(
    objNode,
    intStackIndex,
    arrProperties,
    arrNodeStack)
{
	// Placeholder logic...
	return false;
};
</pre>
<p>Ben Nadel has an excellent writeup on the selector engine interface in his article http://www.bennadel.com/blog/1457-How-To-Build-A-Custom-jQuery-Selector.htm, so no need to cover it again. Now, our next task is to write the guts of our selector. Here&#8217;s the algorithm we are going to be implementing:</p>
<ol>
<li>Split the arguments by &#8216;,&#8217; (comma), so that we have the start and end selectors.</li>
<li>Find the start and end elements that correspond to the start and end selectors.</li>
<li>Is the element we are currently testing between the start and end elements?
<ol>
<li>Yes -&gt; return true</li>
<li>No -&gt; return false</li>
</ol>
</li>
</ol>
<p>This is a relatively easy algorithm to implement. First, let&#8217;s do the chopping:</p>
<pre>    var args = arrProperties[3].split(",");
    var startSelector = args[0];
    var endSelector = args[1];
</pre>
<p>Now that we have the &#8216;between&#8217; selector values, let&#8217;s get the corresponding elements from the element collection.</p>
<pre> var startIndex = -1;
    var endIndex = -1;

    // Find the start and end indexes.
    for (var index = 0; index &lt; arrNodeStack.length; index++)
    {
        if ($(arrNodeStack[index]).is(startSelector) &amp;&amp; startIndex &lt; 0)
            startIndex = index;
        else if ($(arrNodeStack[index]).is(endSelector) &amp;&amp; endIndex &lt; 0)
            endIndex = index;
    }
</pre>
<p><em>$(arrNodeStack[index])</em> gives us the element that we are currently iterating over. In order to see if it matches our start/end selector, we use the jQuery <a href="http://api.jquery.com/is/">is()</a> method. We have a little handling here to keep from overwriting our values if we&#8217;ve already found a match, but it&#8217;s all pretty self-explanatory.</p>
<p>Our last task is to check to see if our selected element is between the start and end elements, and return the appropriate value. That again is pretty straightforward:</p>
<pre>    if (startIndex &gt;= 0 &amp;&amp;
        endIndex &gt; 0 &amp;&amp;
        intStackIndex &gt; startIndex &amp;&amp;
        intStackIndex &lt; endIndex)
        return true;
    else
        return false;
</pre>
<p>Putting this all together, we get the following:</p>
<pre>$.expr[':'].between = function(
    objNode,
    intStackIndex,
    arrProperties,
    arrNodeStack)
{
    var args = arrProperties[3].split(",");
    var startSelector = args[0];
    var endSelector = args[1];

    var startIndex = -1;
    var endIndex = -1;

    // Find the start and end indexes.
    for (var index = 0; index &lt; arrNodeStack.length; index++)
    {
        if ($(arrNodeStack[index]).is(startSelector) &amp;&amp; startIndex &lt; 0)
            startIndex = index;
        else if ($(arrNodeStack[index]).is(endSelector) &amp;&amp; endIndex &lt; 0)
            endIndex = index;
    }

    if (startIndex &gt;= 0 &amp;&amp;
        endIndex &gt; 0 &amp;&amp;
        intStackIndex &gt; startIndex &amp;&amp;
        intStackIndex &lt; endIndex)
        return true;
    else
        return false;
};
</pre>
<p>That&#8217;s it! We&#8217;ve now got the ability to use the &#8216;between&#8217; selector just like any other jQuery selector. Pretty simple, no? From not knowing a thing about selector engine extension to a finished product, this was only a few hours of work (mostly research, too). If you&#8217;re looking for an opportunity to try implementing a custom selector, try that &#8216;previous adjacent&#8217; selector I talked about in the opening paragraph &#8211; it should be pretty easy to implement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2010/05/10/extending-jquery-selectors-between/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Image Overlay 1.3 Released</title>
		<link>http://www.ferretarmy.com/2010/03/29/jquery-image-overlay-1-3-released/</link>
		<comments>http://www.ferretarmy.com/2010/03/29/jquery-image-overlay-1-3-released/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 17:41:06 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Image Overlay]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=509</guid>
		<description><![CDATA[There have been a distinct lack of updates recently on FerretArmy.com &#8211; chock it up to having to do a lot of work-induced overtime over the past few months. Either way, in order to usher in some fresher content, I&#8217;ve updated my Image Overlay plugin to version 1.3. Changes are that you no longer need [...]]]></description>
			<content:encoded><![CDATA[<p>There have been a distinct lack of updates recently on FerretArmy.com &#8211; chock it up to having to do a lot of work-induced overtime over the past few months. Either way, in order to usher in some fresher content, I&#8217;ve updated my Image Overlay plugin to <a href="http://www.ferretarmy.com/files/jQuery/ImageOverlay/ImageOverlay.html">version 1.3</a>. Changes are that you no longer need to specify image width and height, as well as being able to specify different animation speeds for the &#8216;in&#8217; and &#8216;out&#8217; animations.  Hope you enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2010/03/29/jquery-image-overlay-1-3-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4 Released</title>
		<link>http://www.ferretarmy.com/2010/01/15/jquery-1-4-released/</link>
		<comments>http://www.ferretarmy.com/2010/01/15/jquery-1-4-released/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 18:18:07 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery 1.4]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=506</guid>
		<description><![CDATA[jQuery 1.4 is officially out now! The jQuery team is in the process of doing a 14-days-of-jQuery-1.4 promotion, which will run through the 28th of January. This is a major release, with much of the jQuery framework being rewritten in addition to a lot of new functionality. The last major release of jQuery was in [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery 1.4 is officially out now! The jQuery team is in the process of doing a <a href="http://jquery14.com/">14-days-of-jQuery-1.4</a> promotion, which will run through the 28th of January. This is a major release, with much of the jQuery framework being rewritten in addition to a lot of new functionality. The last major release of jQuery was in February 2009, so this has definitely been a long time coming (see my 1.4 preview post <a href="http://www.ferretarmy.com/2009/10/23/jquery-1-4-preview/">here</a>).</p>
<p>There&#8217;s a new set of <a href="http://api.jquery.com/category/version/1.4/">jQuery API</a> documentation, with a new look and some other enhancements. One thing I&#8217;m a big fan of is the ability to see when a particular function was added to jQuery &#8211; it&#8217;s very easy to hone in on the new stuff that way. One thing I feel is still missing is the abilityto jump directly to the function implementation in the library, like how the <a href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html">Google Closure API documentation</a> is setup.</p>
<p>Interestingly, the last day of the 14-days-of-jQuery-1.4 promotion will be the release of <a href="http://blog.jqueryui.com/2009/08/jquery-ui-18a1/">jQuery UI 1.8</a>. jQuery UI 1.8 is looking to be a smaller release &#8211; a bunch of bugfixes and few somewhat underwhelming plugins, as well as support for jQuery 1.4. There are a ton of great jQuery UI widgets and enhancements that are in the <a href="http://jqueryui.pbworks.com/">proposal and development stages</a>, but the pace of development has been very slow, which is disappointing. I&#8217;d very much like to see jQuery UI development kicked into high gear.</p>
<p>Overall, this is looking to be a great jQuery release. I&#8217;m impressed with the performance improvements (addClass is three times as fast now? amazing!), and the new functionality improves the experience dramatically. A lot of functionality that used to have to be gotten through plugins is now in the framework itself, which will be a boon to development. Check it out now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2010/01/15/jquery-1-4-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Closure</title>
		<link>http://www.ferretarmy.com/2009/11/09/google-closure/</link>
		<comments>http://www.ferretarmy.com/2009/11/09/google-closure/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:23:47 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Closure]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=477</guid>
		<description><![CDATA[Google just open sourced Closure, their robust JavaScript library. Closure is used in a variety of Google products, notably GMail and Google Docs. I had a chance to play with it for a few minutes, and I&#8217;m posting my first impressions. Google Closure is a fairly complete JavaScript framework. In that sense, it duplicates a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://code.google.com/closure/"><img class="alignnone size-full wp-image-478" title="Google Closure" src="http://www.ferretarmy.com/wp-content/uploads/2009/11/closureLogo.png" alt="Google Closure" width="128" height="128" /></a></p>
<p>Google just open sourced <a href="http://code.google.com/closure/">Closure</a>, their robust JavaScript library. Closure is used in a variety of Google products, notably <a href="http://mail.google.com">GMail</a> and <a href="http://docs.google.com">Google Docs</a>. I had a chance to play with it for a few minutes, and I&#8217;m posting my first impressions.</p>
<p>Google Closure is a fairly complete JavaScript framework. In that sense, it duplicates a lot of the functionality of existing JavaScript libraries, such as <a href="http://jquery.com/">jQuery</a> and <a href="http://developer.yahoo.com/yui/">YUI</a>. It contains behaviors, AJAX, event handling, selectors, UI components, and more. The syntax is fairly straightforward, but it&#8217;s not the same as other libraries, so there&#8217;s a learning curve in getting acquainted with it.</p>
<p>Closure has excellent dependency management through a robust loading mechanism. Basically, if you don&#8217;t reference a certain piece of the library, rest assured that it&#8217;s not going to load (and slow down your page as a result). In addition, it comes with the <a href="http://code.google.com/closure/compiler/docs/gettingstarted_ui.html">Closure Compiler</a>, which will walk your JavaScript, determine what libraries you need, then aggregate and compress all the required files. Being able to deploy one file instead of many is a great way of speeding up your site.</p>
<p>One thing that irks me is that there only way to get Closure is through Subversion access to the trunk. If Google wants Closure to be adopted widely, they&#8217;re going to need to start offering discrete, packaged versions of it. Many developers (and novices) will be put off by the current distribution method otherwise.</p>
<p>The <a href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/index.html">API</a> is well documented, and has links to the actual code for each method (something that I&#8217;ve not really seen before in API documentation). The API itself is very robust, with a ton of methods and accessors on each object. I&#8217;m not sure I&#8217;m a big fan of the way things are laid out in the API, but I don&#8217;t have enough experience with it to say anything definitively here.</p>
<p>One doesn&#8217;t have to stretch the imagination to believe that Closure has amazing potential. This is, after all, what <a href="http://mail.google.com">GMail</a> is built from. I&#8217;m excited that it&#8217;s been open-sourced and I can&#8217;t wait to use it a bit more. Google has given a grand gift to the developer community with this release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/11/09/google-closure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4 Preview</title>
		<link>http://www.ferretarmy.com/2009/10/23/jquery-1-4-preview/</link>
		<comments>http://www.ferretarmy.com/2009/10/23/jquery-1-4-preview/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 20:02:05 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=470</guid>
		<description><![CDATA[I just found this preview of jQuery 1.4. I read some of this stuff at the jQuery site, but this is a nice explanation of the proposed functionality of the next major version of jQuery. I think the new &#8216;live&#8217; event handlers are going to be great. I can&#8217;t stress how much the &#8216;live&#8217; method [...]]]></description>
			<content:encoded><![CDATA[<p>I just found this <a href="http://www.myphpetc.com/2009/10/preview-of-whats-new-in-jquery-14.html">preview of jQuery 1.4</a>. I read some of this stuff at the jQuery site, but this is a nice explanation of the proposed functionality of the next major version of jQuery.</p>
<p>I think the new &#8216;live&#8217; event handlers are going to be great. I can&#8217;t stress how much the &#8216;live&#8217; method has helped my JavaScript development &#8211; it makes event binding much less of a chore when dynamically creating page content (especially for trivial things, like bindings for button hover behavior). One of the things I&#8217;ve disliked, though, is the change event of dropdowns isn&#8217;t able to be live captured, which has led me to use <a href="http://plugins.jquery.com/project/livequery/">Live Query</a> for those purposes. With 1.4, it can be done with jQuery alone.</p>
<p>It will certainly be interesting to see if the Lazy Load code is included, for on-the-fly .css and .js includes. By conditionally loading javascript and css, a lot of bandwidth could be conserved by choosing to defer file retrieval for little-used site features.</p>
<p>Some of the other cool new features will undoubtedly be radio classes and the offset get/set methods &#8211; I can see using those to save a few lines of code. I&#8217;m betting that there will also be some performance increases with 1.4, so I&#8217;m excited about the release, even if it&#8217;s release is still a few months off yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/10/23/jquery-1-4-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Image Carousel</title>
		<link>http://www.ferretarmy.com/2009/09/29/jquery-ui-image-carousel/</link>
		<comments>http://www.ferretarmy.com/2009/09/29/jquery-ui-image-carousel/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:43:03 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=458</guid>
		<description><![CDATA[I&#8217;ve just released my latest plugin, the jQuery UI Image Carousel! The plugin is a standard-fare image carousel, and it&#8217;s also fully compatible with jQuery UI. It&#8217;s got a few options that make it fairly versatile &#8211; from a minimal look all the way to a collapsible version with a custom header. The JavaScript itself [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.ferretarmy.com/files/jQuery/ImageCarousel/ImageCarousel.html"><img class="size-full wp-image-459 aligncenter" title="jQuery UI Image Carousel" src="http://www.ferretarmy.com/wp-content/uploads/2009/09/carouselPic.jpg" alt="jQuery UI Image Carousel" width="211" height="125" /></a></p>
<p>I&#8217;ve just released my latest plugin, the <a href="http://www.ferretarmy.com/files/jQuery/ImageCarousel/ImageCarousel.html">jQuery UI Image Carousel</a>! The plugin is a standard-fare image carousel, and it&#8217;s also fully compatible with <a href="http://jqueryui.com/">jQuery UI</a>. It&#8217;s got a few options that make it fairly versatile &#8211; from a minimal look all the way to a collapsible version with a custom header.</p>
<p>The JavaScript itself wasn&#8217;t that daunting &#8211; version 1.0 clocks in at around 180 lines. Most of it is presentation management as well &#8211; making sure that the correct jQuery UI classes are applied to the markup, and so forth. In total, it was a bit of a longer exercise &#8211; there was a lot of work to insure compatibility with older versions of IE, for instance. I hope you enjoy, and if you use it, please take a sec to leave a comment with your page URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/09/29/jquery-ui-image-carousel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling Button Clicks The Better Way</title>
		<link>http://www.ferretarmy.com/2009/09/18/disabling-button-clicks-the-better-way/</link>
		<comments>http://www.ferretarmy.com/2009/09/18/disabling-button-clicks-the-better-way/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:57:35 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=449</guid>
		<description><![CDATA[Most of the time when you want to cancel an action on a web page, such as a button click, you&#8217;d return false in the client-side button event handler, as such: &#60;a href="blah..." onclick="return DoAction();"&#62;Link&#60;/a&#62; ... function DoAction() { /*Do Something */ return false; }; However, there&#8217;s a better way, using the event.preventDefault() method. I [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the time when you want to cancel an action on a web page, such as a button click, you&#8217;d return false in the client-side button event handler, as such:</p>
<p><code>&lt;a href="blah..." onclick="return DoAction();"&gt;Link&lt;/a&gt;</code></p>
<p><code>...</code></p>
<p><code>function DoAction() { /*Do Something */ return false; };</code></p>
<p>However, there&#8217;s a better way, using the <a href="https://developer.mozilla.org/en/DOM/event.preventDefault">event.preventDefault()</a> method. I had the need to use this recently, when I was fixing a trivial issue with the <a href="http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/">Filament Group jQuery UI buttons</a> &#8211; my &#8216;a href&#8217; styled buttons were still clickable when they were disabled. An easy solution to this problem is to capture the click and prevent the default action. I hooked this action to all disabled buttons, as such.</p>
<p><code>$(".ui-state-disabled").click(function(event) { event.preventDefault(); });</code></p>
<p>This code isn&#8217;t that robust &#8211; if you were to add or remove the ui-state-disabled class after page load (which I didn&#8217;t have to), you&#8217;d want to make sure to handle it appropriately. Either way, preventDefault() is definitely an elegant solution to disabling a click action.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/09/18/disabling-button-clicks-the-better-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Image Overlay 1.2</title>
		<link>http://www.ferretarmy.com/2009/09/09/jquery-image-overlay-1-2/</link>
		<comments>http://www.ferretarmy.com/2009/09/09/jquery-image-overlay-1-2/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 04:51:07 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Image Overlay]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=447</guid>
		<description><![CDATA[I&#8217;ve updated my image overlay plugin yet again, to version 1.2. Again, it was a fairly minor enhancement &#8211; I added the ability to turn off the animation via an option. The translucent image overlay effect is popping up all over the web nowadays, and I want to make sure that my plugin implementation offers [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated my image overlay plugin yet again, to <a href="http://www.ferretarmy.com/files/jQuery/ImageOverlay/ImageOverlay.html">version 1.2</a>. Again, it was a fairly minor enhancement &#8211; I added the ability to turn off the animation via an option. The translucent image overlay effect is popping up all over the web nowadays, and I want to make sure that my plugin implementation offers as much as any other technique to achieve the overlay effect.</p>
<p>In other development, I&#8217;ve been trying to learn how to implement iPhone style gesture controls via JavaScript. I&#8217;ve been seriously spinning my wheels on this &#8211; my demo is turning out to be a dud, of sorts. It&#8217;s frustrating (especially the testing, which I can only do on my iPhone currently), but hopefully it comes together sooner or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/09/09/jquery-image-overlay-1-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Image Overlay Plugin 1.1</title>
		<link>http://www.ferretarmy.com/2009/08/21/jquery-image-overlay-plugin-1-1/</link>
		<comments>http://www.ferretarmy.com/2009/08/21/jquery-image-overlay-plugin-1-1/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 17:12:35 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Image Overlay]]></category>

		<guid isPermaLink="false">http://www.ferretarmy.com/?p=442</guid>
		<description><![CDATA[A quick note &#8211; I&#8217;ve updated my jQuery Image Overlay Plugin to version 1.1. This version adds support for pinning the overlay so it is always viewable (not just when you mouse over the image). There were no other changes, so you should be able to upgrade without worry.]]></description>
			<content:encoded><![CDATA[<p>A quick note &#8211; I&#8217;ve updated my <a href="http://www.ferretarmy.com/files/jQuery/ImageOverlay/ImageOverlay.html">jQuery Image Overlay Plugin</a> to version 1.1. This version adds support for pinning the overlay so it is always viewable (not just when you mouse over the image). There were no other changes, so you should be able to upgrade without worry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ferretarmy.com/2009/08/21/jquery-image-overlay-plugin-1-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

