<?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>Ajax Bestiary &#187; plugin</title>
	<atom:link href="http://www.ajaxbestiary.com/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxbestiary.com</link>
	<description>AJAX Development, News, Techniques &#38; More</description>
	<lastBuildDate>Wed, 01 Feb 2012 12:46:54 +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>How to Write a jQuery Plugin</title>
		<link>http://www.ajaxbestiary.com/2010/06/09/how-to-write-a-jquery-plugin/</link>
		<comments>http://www.ajaxbestiary.com/2010/06/09/how-to-write-a-jquery-plugin/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:00:00 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2010/06/09/how-to-write-a-jquery-plugin/</guid>
		<description><![CDATA[I know there’s a slew and a half of tutorials on this out there, but I’m adding my own to the mix.&#160; I’ve been working on a generic template for plugin development and have cobbled together what I feel is a solid one. First thing first, however, building a plugin is about being a good [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I know there’s a slew and a half of tutorials on this out there, but I’m adding my own to the mix.&#160; I’ve been working on a generic template for plugin development and have cobbled together what I feel is a solid one.</p>
<p>First thing first, however, building a plugin is about being a good citizen</p>
<ol>
<li><font color="#333333">You’ve got a naming convention to deal with.&#160; jquery[your plugin name].js</font> </li>
<li><font color="#333333">Be considerate of the $.XXX namespace.&#160; Only claim 1, and try to make it both developer friendly and unique.&#160; In our case it will be $.plugin</font> </li>
<li><font color="#333333">Always return this.</font> </li>
<li><font color="#333333">Always end with a “;”</font> </li>
<li><font color="#333333">Wrap the entire thing in an anonymous function call, this will protect the plugin from instances where jquery has been renamed.&#160; </font></li>
</ol>
<p><font color="#333333">So, with all that said and done, the skeleton of a plugin looks like this:</font></p>
<div id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> (<span style="color: #0000ff">function</span>($) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>   $.fn.myPlugin = <span style="color: #0000ff">function</span>(settings) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">var</span> config = {<span style="color: #006080">'foo'</span>: <span style="color: #006080">'bar'</span>};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">if</span> (settings) $.extend(config, settings);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">this</span>.each(<span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>       <span style="color: #008000">// element-specific code here</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>   };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>   </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>    <span style="color: #0000ff">var</span> newMethods = {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>        a   : <span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>                 <span style="color: #0000ff">var</span> config = {<span style="color: #006080">'foo'</span>: <span style="color: #006080">'bar'</span>};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>                 <span style="color: #0000ff">if</span> (settings) $.extend(config, settings);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>                <span style="color: #0000ff">this</span>.each(<span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>                   <span style="color: #008000">// element-specific code here</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>                 });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>                 <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>                   },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>        b   : <span style="color: #0000ff">function</span>() { <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span> },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>        c     : <span style="color: #0000ff">function</span>() { <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span> }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>       };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>       </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>  jQuery.each(newMethods, <span style="color: #0000ff">function</span>(i) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>    jQuery.fn.myPlugin[i] = <span style="color: #0000ff">this</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>  });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span> })(jQuery);</pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<p>Note, what this code is doing.</p>
<p>First, we define the core behavior of the plugin, then extend the plugin once.&#160; This way we keep our declarations concise, clear and well encapsulated.</p>
<p>We have an established closure structure for shared private functions.</p>
<p>We keep everything encapsulated to protect the jquery namespace as much as possible, and iterate over the child functions to extend the plugin.</p>
<p>PS– most of this is adapted from the jquery extension guide here: <a title="http://docs.jquery.com/Plugins/Authoring" href="http://docs.jquery.com/Plugins/Authoring">http://docs.jquery.com/Plugins/Authoring</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2010/06/09/how-to-write-a-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Smart Area: A Lightweight Resizing Text Area Plugin for jQuery</title>
		<link>http://www.ajaxbestiary.com/2007/11/14/smart-area-a-lightweight-resizing-text-area-plugin-for-jquery/</link>
		<comments>http://www.ajaxbestiary.com/2007/11/14/smart-area-a-lightweight-resizing-text-area-plugin-for-jquery/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 18:54:10 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/11/14/smart-area-a-lightweight-resizing-text-area-plugin-for-jquery/</guid>
		<description><![CDATA[Here&#8217;s a quick and dirty little jQuery plugin to create text areas that automatically resize. I based it off of Richard McMahon&#8217;s Prototype Version jQuery.fn.smartArea = function (){ return this.each(function() { if (!jQuery(this).is("textarea")) { return false; } jQuery(this).click( function(){ jQuery.SA.resizeArea( this ); } ) .keyup( function(){ jQuery.SA.resizeArea( this ); } ); return this; }); } [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Here&#8217;s a quick and dirty little jQuery plugin to create text areas that automatically resize.</p>
<p>I based it off of <a href="http://jroller.com/rmcmahon/entry/resizingtextarea_with_prototype">Richard McMahon&#8217;s Prototype Version</a></p>
<p><code>jQuery.fn.smartArea = function (){</p>
<p>return this.each(function() {<br />
if (!jQuery(this).is("textarea")) {<br />
return false;<br />
}</p>
<p>jQuery(this).click( function(){<br />
jQuery.SA.resizeArea( this ); } )<br />
.keyup( function(){<br />
jQuery.SA.resizeArea( this ); } );<br />
return this;</p>
<p>});</p>
<p>}</p>
<p>jQuery.SA = {<br />
resizeArea : function ( t ) {</p>
<p>var lines = t.value.split('\n') || [];<br />
var newRows = lines.length;<br />
var oldRows = t.rows;<br />
for (var i = 0; i &lt; lines.length; i++)<br />
{ var line = lines[i]; if (line.length &gt;= t.cols) newRows += Math.floor(line.length / t.cols);<br />
}<br />
if (newRows &gt; t.rows) t.rows = newRows;<br />
if (newRows &lt; t.rows) t.rows = Math.max(1, newRows);</p>
<p>}<br />
}</code></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/11/14/smart-area-a-lightweight-resizing-text-area-plugin-for-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>jQuery Dimension Plugin, Spacial Awareness Made Simple</title>
		<link>http://www.ajaxbestiary.com/2007/10/31/jquery-dimension-plugin-spacial-awareness-made-simple/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/31/jquery-dimension-plugin-spacial-awareness-made-simple/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 14:14:38 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/31/jquery-dimension-plugin-spacial-awareness-made-simple/</guid>
		<description><![CDATA[One of the most powerful jQuery plugins is dimension.  Using dimension you can obtain the position, height &#38; width of just about any element on the page and the window itself. Uses: Determine dimensions of document Determine dimensions of window Determine scroll offsets of containers Set scroll offsets of containers Determine dimensions of container contents [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>One of the most powerful jQuery plugins is dimension.  Using dimension you can obtain the position, height &amp; width of just about any element on the page and the window itself.</p>
<p><strong>Uses:</strong></p>
<ul>
<li>Determine dimensions of document</li>
<li>Determine dimensions of window</li>
<li>Determine scroll offsets of containers</li>
<li>Set scroll offsets of containers</li>
<li>Determine dimensions of container contents</li>
<li>Determine absolute position of elements</li>
<li>Determine dimensions &amp; offsets of parent elements.</li>
</ul>
<p>Find Plugin &amp; API Documentation here:</p>
<p><a href="http://brandonaaron.net/docs/dimensions/"> http://brandonaaron.net/docs/dimensions/</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/31/jquery-dimension-plugin-spacial-awareness-made-simple/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

