<?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>Personal blog of Chris Ergatides &#187; css</title>
	<atom:link href="http://blog.ergatides.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ergatides.com</link>
	<description>jQuery, Linux, Technology, Web Design and random stuff.</description>
	<lastBuildDate>Mon, 06 Feb 2012 05:01:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>CSS Frameworks: In with the New, Out with the Old</title>
		<link>http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-frameworks-in-with-the-new-out-with-the-old</link>
		<comments>http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 16:00:14 +0000</pubDate>
		<dc:creator>Chris Ergatides</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[960gs]]></category>
		<category><![CDATA[blueprint]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[grid systems]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://blog.ergatides.com/?p=1269</guid>


		<description><![CDATA[<p>I&#8217;ve noticed that my old post <a href="http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/" target="_blank">960 Grid System vs Blueprint CSS</a> is still getting quite a few hits so I thought I&#8217;d post an update about it.</p>
<p>Of the two, I now use&#8230; <strong>neither</strong>!</p>
<blockquote><p>Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.</p></blockquote>
<p>Just the other day I built a nice page in a matter of a few minutes using <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap, from Twitter</a> and it has me totally sold. If you need to throw something together quickly, then this is the way to go. Things I like about Bootstrap:</p>
<ul>
<li>Single css file to include which includes reset CSS (no need for multiple css files).</li>
<li>Remotely hosted for quickstart. Bootstrap itself suggests to use <em>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css&#8221;&gt;</em></li>
<li>Simple <a href="http://twitter.github.com/bootstrap/#grid-system" target="_blank">markup</a></li>
<li>Customizable fixed or fluid layouts</li>
<li><a href="http://twitter.github.com/bootstrap/#typography" target="_blank">Typography</a> that just works (check out the inline labels).</li>
<li><a href="http://twitter.github.com/bootstrap/#media" target="_blank">Media markup</a> (although I haven&#8217;t actually understood the purpose of it yet).</li>
<li>Very nice <a href="http://twitter.github.com/bootstrap/#tables" target="_blank">Tables</a> with support for <a href="http://tablesorter.com/docs/" target="_blank">tablesorter</a>.</li>
<li>Beautiful <a href="http://twitter.github.com/bootstrap/#forms" target="_blank">Forms</a> with sexy buttons.</li>
<li><a href="http://twitter.github.com/bootstrap/#navigation" target="_blank">Navigation/Tab/Breadcrumb/Pagination</a></li>
<li>Sexy <a href="http://twitter.github.com/bootstrap/#alerts" target="_blank">Alerts &amp; Navigation </a></li>
<li>&#8230; and a whole bunch of things you can do by adding small javascript snippets, such as modal dialogs, popovers, etc&#8230;</li>
</ul>
<p>Definitely worth checking out if you are researching CSS frameworks and haven&#8217;t tried it yet!</p>
<p>Related posts:</p><ol>
<li><a href='http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/' rel='bookmark' title='CSS Frameworks, 960 Grid System vs Blueprint CSS'>CSS Frameworks, 960 Grid System vs Blueprint CSS</a></li>
<li><a href='http://blog.ergatides.com/2011/12/01/new-google-navigation-bar/' rel='bookmark' title='New Google Navigation Bar'>New Google Navigation Bar</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed that my old post <a href="http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/" target="_blank">960 Grid System vs Blueprint CSS</a> is still getting quite a few hits so I thought I&#8217;d post an update about it.</p>
<p>Of the two, I now use&#8230; <strong>neither</strong>!</p>
<blockquote><p>Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.</p></blockquote>
<p>Just the other day I built a nice page in a matter of a few minutes using <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap, from Twitter</a> and it has me totally sold. If you need to throw something together quickly, then this is the way to go. Things I like about Bootstrap:</p>
<ul>
<li>Single css file to include which includes reset CSS (no need for multiple css files).</li>
<li>Remotely hosted for quickstart. Bootstrap itself suggests to use <em>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css&#8221;&gt;</em></li>
<li>Simple <a href="http://twitter.github.com/bootstrap/#grid-system" target="_blank">markup</a></li>
<li>Customizable fixed or fluid layouts</li>
<li><a href="http://twitter.github.com/bootstrap/#typography" target="_blank">Typography</a> that just works (check out the inline labels).</li>
<li><a href="http://twitter.github.com/bootstrap/#media" target="_blank">Media markup</a> (although I haven&#8217;t actually understood the purpose of it yet).</li>
<li>Very nice <a href="http://twitter.github.com/bootstrap/#tables" target="_blank">Tables</a> with support for <a href="http://tablesorter.com/docs/" target="_blank">tablesorter</a>.</li>
<li>Beautiful <a href="http://twitter.github.com/bootstrap/#forms" target="_blank">Forms</a> with sexy buttons.</li>
<li><a href="http://twitter.github.com/bootstrap/#navigation" target="_blank">Navigation/Tab/Breadcrumb/Pagination</a></li>
<li>Sexy <a href="http://twitter.github.com/bootstrap/#alerts" target="_blank">Alerts &amp; Navigation </a></li>
<li>&#8230; and a whole bunch of things you can do by adding small javascript snippets, such as modal dialogs, popovers, etc&#8230;</li>
</ul>
<p>Definitely worth checking out if you are researching CSS frameworks and haven&#8217;t tried it yet!</p>
<p>Related posts:</p><ol>
<li><a href='http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/' rel='bookmark' title='CSS Frameworks, 960 Grid System vs Blueprint CSS'>CSS Frameworks, 960 Grid System vs Blueprint CSS</a></li>
<li><a href='http://blog.ergatides.com/2011/12/01/new-google-navigation-bar/' rel='bookmark' title='New Google Navigation Bar'>New Google Navigation Bar</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Frameworks, 960 Grid System vs Blueprint CSS</title>
		<link>http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-frameworks-960-grid-system-vs-blueprint-css</link>
		<comments>http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 12:09:27 +0000</pubDate>
		<dc:creator>Chris Ergatides</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[frameworks]]></category>

		<guid isPermaLink="false">http://blog.ergatides.com/?p=217</guid>


		<description><![CDATA[<p>I&#8217;m relatively new to CSS frameworks and my experience with them is limited. In my opinion all CSS frameworks should be easy to learn and ultimately make your life easier, right? Wrong!</p>
<p>Don&#8217;t ask me why, but my first chosen CSS framework to play with was <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>. So I print out a friendly cheatsheet and go over a few examples and everything seems to work fine and I think that&#8217;s great, that will come in handy one day. That day was Thursday, when at the office, I was asked to slice up a JPG and make it look like a real website. I said I&#8217;d have it done by the end of Friday. Little did I know that <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> was going to let me down, which it did. I got stuck on the very first block and via this post, maybe somebody can spot where I might have gone wrong.</p>
<p>Note that for the following test, I have removed all other javascript and css files from my page and the only thing loaded is the <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> framework, nothing else. Let&#8217;s take a look at the code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;span-24 last&quot;&gt;
        &lt;div class=&quot;span-4 first&quot;&gt;4&lt;/div&gt;
        &lt;div class=&quot;span-10&quot;&gt;10&lt;/div&gt;
        &lt;div class=&quot;span-10 last&quot;&gt;10&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Based on samples and support threads that I have read, the first &#8220;last&#8221; on the span-24 should not be required as it is &#8220;special cased&#8221; apparently and nor should the &#8220;first&#8221; in span-4 be needed but I have tried everything with and without these to no effect. Note also that NONE of these div have any borders, padding or margins applied to them whatsoever (If you need borders/padding/margins, you apply it to elements inside the span-x divs because <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> is a &#8220;pixel perfect&#8221; framework). I also tried removing the span-24 div altogether, leaving just the 3 inner divs.</p>
<p>So, what do you expect to see? I expect this:</p>
<table style="border: 0; width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td width="16%">4</td>
<td width="42%">10</td>
<td width="42%">10</td>
</tr>
</tbody>
</table>
<p>Instead I get this:</p>
<table style="border: 0; width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td width="16%">4<br />
10</td>
<td width="84%">10</td>
</tr>
</tbody>
</table>
<p>I tried different doctypes, disabled all of my Firefox extensions, tried in Chrome, Opera etc&#8230; without any difference. By now I&#8217;m very frustrated that I can&#8217;t do the most simple thing that I could do manually in CSS, but that&#8217;s besides the point. <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> should work as advertised or at the very least provide better documentation to deal with the demonstrated problem.</p>
<p>Having passed my Friday deadline for the mockup, I&#8217;ve had to find an alternative and fast and work through my weekend to have it done for Monday morning. And that&#8217;s where <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a> comes in to the picture. I&#8217;d seen this framework before, never used it but liked the look of it, and quite like the idea that it is ~6KB to load up instead of ~15KB that&#8217;s needed with <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>.</p>
<p>Now, although I still haven&#8217;t been able to find a cheatsheet for the <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a>, I found a basic tutorial over at <a href="http://divitodesign.com/css/960-css-framework-learn-basics/">DivitoDesign</a> which is nice and easy to follow. Notably, in that tutorial, there&#8217;s a section which clearly explains Margins and how to use the framework to accommodate for these.</p>
<p>As a result, this is the code which I came up with in order to achieve my goal:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container_24&quot;&gt;
    &lt;div class=&quot;grid_24&quot;&gt;
        &lt;div class=&quot;grid_4 alpha&quot;&gt;4&lt;/div&gt;
        &lt;div class=&quot;grid_10&quot;&gt;10&lt;/div&gt;
        &lt;div class=&quot;grid_10 omega&quot;&gt;10&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And yes! it did work out of the box, which is exactly what I expected <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> to do. As a result, at the end of the day, I&#8217;ll be using <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a>. As stated above, I have absolutely nothing against <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>, and if anything I&#8217;m hoping that somebody can point out where I might have gone wrong with it.</p>
<p><span style="color: #ff0000;"><strong>2011-11-18 UPDATE</strong></span>: If you are researching CSS frameworks, you might want to check out my <a href="http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/">CSS Frameworks: In with the New, Out with the Old</a> thread too.</p>
<p>Related posts:</p><ol>
<li><a href='http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/' rel='bookmark' title='CSS Frameworks: In with the New, Out with the Old'>CSS Frameworks: In with the New, Out with the Old</a></li>
<li><a href='http://blog.ergatides.com/2011/07/29/12th-annual-system-administrator-appreciation-day/' rel='bookmark' title='12th Annual System Administrator Appreciation Day'>12th Annual System Administrator Appreciation Day</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m relatively new to CSS frameworks and my experience with them is limited. In my opinion all CSS frameworks should be easy to learn and ultimately make your life easier, right? Wrong!</p>
<p>Don&#8217;t ask me why, but my first chosen CSS framework to play with was <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>. So I print out a friendly cheatsheet and go over a few examples and everything seems to work fine and I think that&#8217;s great, that will come in handy one day. That day was Thursday, when at the office, I was asked to slice up a JPG and make it look like a real website. I said I&#8217;d have it done by the end of Friday. Little did I know that <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> was going to let me down, which it did. I got stuck on the very first block and via this post, maybe somebody can spot where I might have gone wrong.</p>
<p>Note that for the following test, I have removed all other javascript and css files from my page and the only thing loaded is the <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> framework, nothing else. Let&#8217;s take a look at the code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;span-24 last&quot;&gt;
        &lt;div class=&quot;span-4 first&quot;&gt;4&lt;/div&gt;
        &lt;div class=&quot;span-10&quot;&gt;10&lt;/div&gt;
        &lt;div class=&quot;span-10 last&quot;&gt;10&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Based on samples and support threads that I have read, the first &#8220;last&#8221; on the span-24 should not be required as it is &#8220;special cased&#8221; apparently and nor should the &#8220;first&#8221; in span-4 be needed but I have tried everything with and without these to no effect. Note also that NONE of these div have any borders, padding or margins applied to them whatsoever (If you need borders/padding/margins, you apply it to elements inside the span-x divs because <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> is a &#8220;pixel perfect&#8221; framework). I also tried removing the span-24 div altogether, leaving just the 3 inner divs.</p>
<p>So, what do you expect to see? I expect this:</p>
<table style="border: 0; width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td width="16%">4</td>
<td width="42%">10</td>
<td width="42%">10</td>
</tr>
</tbody>
</table>
<p>Instead I get this:</p>
<table style="border: 0; width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td width="16%">4<br />
10</td>
<td width="84%">10</td>
</tr>
</tbody>
</table>
<p>I tried different doctypes, disabled all of my Firefox extensions, tried in Chrome, Opera etc&#8230; without any difference. By now I&#8217;m very frustrated that I can&#8217;t do the most simple thing that I could do manually in CSS, but that&#8217;s besides the point. <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> should work as advertised or at the very least provide better documentation to deal with the demonstrated problem.</p>
<p>Having passed my Friday deadline for the mockup, I&#8217;ve had to find an alternative and fast and work through my weekend to have it done for Monday morning. And that&#8217;s where <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a> comes in to the picture. I&#8217;d seen this framework before, never used it but liked the look of it, and quite like the idea that it is ~6KB to load up instead of ~15KB that&#8217;s needed with <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>.</p>
<p>Now, although I still haven&#8217;t been able to find a cheatsheet for the <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a>, I found a basic tutorial over at <a href="http://divitodesign.com/css/960-css-framework-learn-basics/">DivitoDesign</a> which is nice and easy to follow. Notably, in that tutorial, there&#8217;s a section which clearly explains Margins and how to use the framework to accommodate for these.</p>
<p>As a result, this is the code which I came up with in order to achieve my goal:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container_24&quot;&gt;
    &lt;div class=&quot;grid_24&quot;&gt;
        &lt;div class=&quot;grid_4 alpha&quot;&gt;4&lt;/div&gt;
        &lt;div class=&quot;grid_10&quot;&gt;10&lt;/div&gt;
        &lt;div class=&quot;grid_10 omega&quot;&gt;10&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And yes! it did work out of the box, which is exactly what I expected <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a> to do. As a result, at the end of the day, I&#8217;ll be using <a href="http://bit.ly/aVMQDU" target="_blank" title="960 Grid System">960 Grid System</a>. As stated above, I have absolutely nothing against <a href="http://bit.ly/9Nnb6X" target="_blank" title="Blueprint: A CSS Framework | Spend your time ...">Blueprint CSS</a>, and if anything I&#8217;m hoping that somebody can point out where I might have gone wrong with it.</p>
<p><span style="color: #ff0000;"><strong>2011-11-18 UPDATE</strong></span>: If you are researching CSS frameworks, you might want to check out my <a href="http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/">CSS Frameworks: In with the New, Out with the Old</a> thread too.</p>
<p>Related posts:</p><ol>
<li><a href='http://blog.ergatides.com/2011/11/18/css-frameworks-in-with-the-new-out-with-the-old/' rel='bookmark' title='CSS Frameworks: In with the New, Out with the Old'>CSS Frameworks: In with the New, Out with the Old</a></li>
<li><a href='http://blog.ergatides.com/2011/07/29/12th-annual-system-administrator-appreciation-day/' rel='bookmark' title='12th Annual System Administrator Appreciation Day'>12th Annual System Administrator Appreciation Day</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://blog.ergatides.com/2010/03/21/css-frameworks-960-grid-system-vs-blueprint-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting equal CSS heights using jQuery.</title>
		<link>http://blog.ergatides.com/2009/07/02/setting-equal-css-heights-using-jquery/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-equal-css-heights-using-jquery</link>
		<comments>http://blog.ergatides.com/2009/07/02/setting-equal-css-heights-using-jquery/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 11:18:49 +0000</pubDate>
		<dc:creator>Chris Ergatides</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[height]]></category>

		<guid isPermaLink="false">http://ergatides.com/blog/?p=1</guid>


		<description><![CDATA[<p>I recently needed to do this and found a solution over at <a href="http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/" target="_self">filament group</a>, however, I wanted the flexibility to specify the elements to work with.</p>
<p>This is what I came up with:</p>
<pre class="brush: jscript; title: ; notranslate">
(function($) {
    $.equalHeight = function(element) {
        var maxHeight = 0;
        $.each(element, function() {
            if ($(this).height() &gt; maxHeight) {
                 maxHeight = $(this).height();
            }
        });
        $.each(element, function() {
            $(this).height(maxHeight);
        });
    }
})(jQuery);
</pre>
<p>And an example of usage:</p>
<pre class="brush: jscript; title: ; notranslate">
var obj = {
    one:$(&quot;#pinned .content&quot;),
    two:$(&quot;#top10 .content&quot;)
};
$.equalHeight(obj);
</pre>
<p>Demo:<br />
<script type="text/javascript">// <![CDATA[
(function($) {
	$.equalHeight = function(element, animate) {
		var maxHeight = 0;
		$.each(element, function() {
			if ($(this).height() > maxHeight) {
				maxHeight = $(this).height();
			}
		});
		$.each(element, function() {
			if (animate) {
				$(this).fadeTo(1000, 1).animate({ "height":maxHeight }, "slow");
			} else {
				$(this).fadeTo(1000, 1).animate({ "height":maxHeight }, 0);
			}
		});
	}
})(jQuery);

function execute(animate) {
	reset();
	var obj = { one:$("#div1"), two:$("#div2"), three:$("#div3") };
	$.equalHeight(obj, animate);
}

function reset() {
	$("#div1").css("height", "50px");
	$("#div2").css("height", "100px");
	$("#div3").css("height", "75px");
}
// ]]&gt;</script></p>
<div id="div1" class="boxes" style="background-color: red; float: left; height: 50px; width: 10px;"></div>
<div id="div2" class="boxes" style="background-color: green; float: left; height: 100px; width: 10px;"></div>
<div id="div3" class="boxes" style="background-color: blue; float: left; height: 75px; width: 10px;"></div>
<p><br style="clear: both;" /><br />
<button onclick="execute(false);">TEST WITHOUT ANIMATION</button><br />
<button onclick="execute(true);">TEST WITH ANIMATION</button><br />
<button onclick="reset();">RESET</button><br />
<br style="clear: both;" /></p>
<p>No related posts.</p>]]></description>
			<content:encoded><![CDATA[<p>I recently needed to do this and found a solution over at <a href="http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/" target="_self">filament group</a>, however, I wanted the flexibility to specify the elements to work with.</p>
<p>This is what I came up with:</p>
<pre class="brush: jscript; title: ; notranslate">
(function($) {
    $.equalHeight = function(element) {
        var maxHeight = 0;
        $.each(element, function() {
            if ($(this).height() &gt; maxHeight) {
                 maxHeight = $(this).height();
            }
        });
        $.each(element, function() {
            $(this).height(maxHeight);
        });
    }
})(jQuery);
</pre>
<p>And an example of usage:</p>
<pre class="brush: jscript; title: ; notranslate">
var obj = {
    one:$(&quot;#pinned .content&quot;),
    two:$(&quot;#top10 .content&quot;)
};
$.equalHeight(obj);
</pre>
<p>Demo:<br />
<script type="text/javascript">// <![CDATA[
(function($) {
	$.equalHeight = function(element, animate) {
		var maxHeight = 0;
		$.each(element, function() {
			if ($(this).height() > maxHeight) {
				maxHeight = $(this).height();
			}
		});
		$.each(element, function() {
			if (animate) {
				$(this).fadeTo(1000, 1).animate({ "height":maxHeight }, "slow");
			} else {
				$(this).fadeTo(1000, 1).animate({ "height":maxHeight }, 0);
			}
		});
	}
})(jQuery);

function execute(animate) {
	reset();
	var obj = { one:$("#div1"), two:$("#div2"), three:$("#div3") };
	$.equalHeight(obj, animate);
}

function reset() {
	$("#div1").css("height", "50px");
	$("#div2").css("height", "100px");
	$("#div3").css("height", "75px");
}
// ]]&gt;</script></p>
<div id="div1" class="boxes" style="background-color: red; float: left; height: 50px; width: 10px;"></div>
<div id="div2" class="boxes" style="background-color: green; float: left; height: 100px; width: 10px;"></div>
<div id="div3" class="boxes" style="background-color: blue; float: left; height: 75px; width: 10px;"></div>
<p><br style="clear: both;" /><br />
<button onclick="execute(false);">TEST WITHOUT ANIMATION</button><br />
<button onclick="execute(true);">TEST WITH ANIMATION</button><br />
<button onclick="reset();">RESET</button><br />
<br style="clear: both;" /></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.ergatides.com/2009/07/02/setting-equal-css-heights-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

