<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: The Evolution of a jQuery Plugin</title>
	<atom:link href="http://scrunchup.com/issue-2/the-evolution-of-a-jquery-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrunchup.com/article/the-evolution-of-a-jquery-plugin/</link>
	<description>The Web Magazine for Young Designers and Developers</description>
	<lastBuildDate>Sun, 05 Feb 2012 16:25:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Ted Lilley</title>
		<link>http://scrunchup.com/article/the-evolution-of-a-jquery-plugin/#comment-445</link>
		<dc:creator>Ted Lilley</dc:creator>
		<pubDate>Tue, 08 Feb 2011 22:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://scrunchup.com/?p=474#comment-445</guid>
		<description>The final code fails because it&#039;s trying to call jQuery methods on &quot;this&quot;, which is not a jQuery object at that point.  The &quot;this&quot; references needed to be converted to jQuery objects by the factory function &quot;$(this)&quot;.  The modified code worked for me:

jQuery.fn.extend({
slideOut : function() {
//execute on each item in the jQuery collection, returning the same collection.
return this.each(function(speed) {
$(this).data(&#039;oldwidth&#039;, $(this).css(&#039;width&#039;))
.css({width: &#039;0px&#039;})
//animate with a default width of 500ms
.animate({ width: $(this).data(&#039;oldwidth&#039;) }, (speed ? speed : 500));
});
}
});</description>
		<content:encoded><![CDATA[<p>The final code fails because it&#8217;s trying to call jQuery methods on &#8220;this&#8221;, which is not a jQuery object at that point.  The &#8220;this&#8221; references needed to be converted to jQuery objects by the factory function &#8220;$(this)&#8221;.  The modified code worked for me:</p>
<p>jQuery.fn.extend({<br />
slideOut : function() {<br />
//execute on each item in the jQuery collection, returning the same collection.<br />
return this.each(function(speed) {<br />
$(this).data(&#8216;oldwidth&#8217;, $(this).css(&#8216;width&#8217;))<br />
.css({width: &#8217;0px&#8217;})<br />
//animate with a default width of 500ms<br />
.animate({ width: $(this).data(&#8216;oldwidth&#8217;) }, (speed ? speed : 500));<br />
});<br />
}<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://scrunchup.com/article/the-evolution-of-a-jquery-plugin/#comment-208</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Mon, 05 Apr 2010 14:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://scrunchup.com/?p=474#comment-208</guid>
		<description>This code didn&#039;t work.  How about a demo link?</description>
		<content:encoded><![CDATA[<p>This code didn&#8217;t work.  How about a demo link?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

