<?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>bluefeet &#187; jQuery</title>
	<atom:link href="http://blog.bluefeet.net/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bluefeet.net</link>
	<description>Yet another Perl Hacker weblog</description>
	<lastBuildDate>Thu, 10 Jun 2010 15:22:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>$(document).ready() Shortcut</title>
		<link>http://blog.bluefeet.net/2009/07/document-ready-shortcut/</link>
		<comments>http://blog.bluefeet.net/2009/07/document-ready-shortcut/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 21:54:32 +0000</pubDate>
		<dc:creator>bluefeet</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.bluefeet.net/?p=144</guid>
		<description><![CDATA[When writing jquery you almost always put your code within a ready block:
$&#40;document&#41;.ready&#40;function&#40;&#41;&#123;
&#160; &#160; // Code...
&#125;&#41;;
And I always forget the exact syntax.  I just found that jQuery has a shortcut:
$&#40;function&#40;&#41;&#123;
&#160; &#160; // Code...
&#125;&#41;;
Much better!
]]></description>
			<content:encoded><![CDATA[<p>When writing jquery you almost always put your code within a ready block:</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Code...</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>And I always forget the exact syntax.  I just found that jQuery has a shortcut:</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<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><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Code...</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Much better!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bluefeet.net/2009/07/document-ready-shortcut/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Element Sizing</title>
		<link>http://blog.bluefeet.net/2009/05/css-element-sizing/</link>
		<comments>http://blog.bluefeet.net/2009/05/css-element-sizing/#comments</comments>
		<pubDate>Tue, 12 May 2009 12:41:06 +0000</pubDate>
		<dc:creator>bluefeet</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.bluefeet.net/?p=30</guid>
		<description><![CDATA[While working on our new UI at $work we ran in to issues using the YUI layout manager as its very quirky and hard to customize. So, I ended up writing an entirely new layout manager. As part of this I found that the way I thought elements resized was nothing like reality. I&#8217;m a [...]]]></description>
			<content:encoded><![CDATA[<p>While working on our new UI at $work we ran in to issues using the YUI layout manager as its very quirky and hard to customize. So, I ended up writing an entirely new layout manager. As part of this I found that the way I thought elements resized was nothing like reality. I&#8217;m a big <a href="http://jquery.com">jQuery</a> fan so this diagram below refers to jQuery methods, but the concept applies to CSS in general.</p>
<p><img class="alignnone size-full wp-image-29" title="css_element_sizing" src="http://blog.bluefeet.net/wp-content/uploads/2009/06/css_element_sizing.png" alt="css_element_sizing" width="390" height="195" /></p>
<p>As you can see the height of an element represent only the internal height of the element, not taking in to account the margin, border, or padding. This I already knew, but I didn&#8217;t know how the corresponding jQuery methods fit in here. jQuery.height() has the same value as the CSS height attribute. jQuery.innerHeight is the CSS height plus the CSS top and bottom padding. jQuery.outerHeight() includes the CSS height, the top and bottom padding, and the top and bottom border. And, finally, jQuery.outerHeight(true) works the same as jQuery.outerHeight(), but also includes the top and bottom margin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bluefeet.net/2009/05/css-element-sizing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting an Element&#8217;s Outer Size</title>
		<link>http://blog.bluefeet.net/2009/05/setting-an-elements-outer-size/</link>
		<comments>http://blog.bluefeet.net/2009/05/setting-an-elements-outer-size/#comments</comments>
		<pubDate>Tue, 12 May 2009 12:07:11 +0000</pubDate>
		<dc:creator>bluefeet</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.bluefeet.net/?p=6</guid>
		<description><![CDATA[When setting an element&#8217;s width or height you are setting the inner-most width and height, without taking in to account the padding, border, or margin. When writing application-like web sites this is not the behavior you want &#8211; usually you want exact control of the entire width and height of the element. Here&#8217;s a very [...]]]></description>
			<content:encoded><![CDATA[<p>When setting an element&#8217;s width or height you are setting the inner-most width and height, without taking in to account the padding, border, or margin. When writing application-like web sites this is not the behavior you want &#8211; usually you want exact control of the entire width and height of the element. Here&#8217;s a very simple jQuery plugin that I wrote to make this very easy to do.</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">setOuterWidth</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> newWidth <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> difference <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span> newWidth <span style="color: #339933;">-</span> difference <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<br />
jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">setOuterHeight</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> newHeight <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> difference <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span> newHeight <span style="color: #339933;">-</span> difference <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<p>Then all you have to do is use obj.setOuterWidth(&#8230;) instead of obj.width(&#8230;) to resize the entire element.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bluefeet.net/2009/05/setting-an-elements-outer-size/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
