<?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>Michael Hartmayer - Portfolio &#187; CSS</title>
	<atom:link href="http://www.michaelhartmayer.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelhartmayer.com</link>
	<description>Have a Leet Smoothy</description>
	<lastBuildDate>Wed, 21 Jul 2010 04:04:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>960gs Margin Mod</title>
		<link>http://www.michaelhartmayer.com/css/960gs-margin-mod/</link>
		<comments>http://www.michaelhartmayer.com/css/960gs-margin-mod/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 21:31:07 +0000</pubDate>
		<dc:creator>Michael Hartmayer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[960]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://www.michaelhartmayer.com/?p=359</guid>
		<description><![CDATA[Lately I&#8217;ve been working with the marvelously easy to use and understand CSS framework, 960 Grid System. After getting started with it, I very quickly noticed that, while easy and efficient, it has a flaw. You absolutely can NOT extend your elements to end after a margin, touching the next grid element. And so, one [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been working with the marvelously easy to use and understand CSS framework, <a href="http://960.gs" title="960 Grid System" target="_blank">960 Grid System</a>. After getting started with it, I very quickly noticed that, while easy and efficient, it has a flaw. You absolutely can NOT extend your elements to end after a margin, touching the next grid element. And so, one becomes effectively shackled to having margins between any horizontally placed grid elements.</p>
<p>Here&#8217;s a quick Mod that I wrote that will allow you to negate that problem, without modifying the 960gs CSS itself. Also, it is important to note, that while this does allow you to push your grid class over the margin, you still can&#8217;t pull the next element back. Still, another mod could be written using the same flavor to accomplish that as well.</p>
<p>So, without further adieu, here it is:</p>
<p>960.overExtend.css</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
&nbsp;
Modifies the 960gs to allow elements to carry over
into the margins, so that they may snugly touch
the next grid over. Simply use the appropriate grid,
as you normally would, and then attach the additional
overExtend class to it, to make it over extend into
the margin. 
&nbsp;
Example:
&nbsp;
&lt;div id=&quot;myContainer&quot; class=&quot;grid_5 grid_5_overExtend&quot;&gt;
...
&lt;/div&gt;
&nbsp;
*/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Margin Mod 12 Col */</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_1_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_2_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">160px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_3_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">240px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_4_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">320px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_5_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_6_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">480px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_7_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">560px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_8_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">640px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_9_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">720px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_10_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">800px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_12</span> <span style="color: #6666ff;">.grid_11_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">880px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Margin Mod 16 Col */</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_1_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">60px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_2_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">120px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_3_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_4_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">240px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_5_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_6_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">360px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_7_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">420px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_8_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">480px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_9_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">540px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_10_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">600px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_11_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">660px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_12_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">720px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_13_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">780px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_14_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">840px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.container_16</span> <span style="color: #6666ff;">.grid_15_overExtend</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">900px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>


<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod&amp;bodytext=Lately%20I%27ve%20been%20working%20with%20the%20marvelously%20easy%20to%20use%20and%20understand%20CSS%20framework%2C%20960%20Grid%20System.%20After%20getting%20started%20with%20it%2C%20I%20very%20quickly%20noticed%20that%2C%20while%20easy%20and%20efficient%2C%20it%20has%20a%20flaw.%20You%20absolutely%20can%20NOT%20extend%20your%20elements%20" title="Digg"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F" title="Sphinn"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod&amp;notes=Lately%20I%27ve%20been%20working%20with%20the%20marvelously%20easy%20to%20use%20and%20understand%20CSS%20framework%2C%20960%20Grid%20System.%20After%20getting%20started%20with%20it%2C%20I%20very%20quickly%20noticed%20that%2C%20while%20easy%20and%20efficient%2C%20it%20has%20a%20flaw.%20You%20absolutely%20can%20NOT%20extend%20your%20elements%20" title="del.icio.us"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;t=960gs%20Margin%20Mod" title="Facebook"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod" title="Mixx"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod&amp;annotation=Lately%20I%27ve%20been%20working%20with%20the%20marvelously%20easy%20to%20use%20and%20understand%20CSS%20framework%2C%20960%20Grid%20System.%20After%20getting%20started%20with%20it%2C%20I%20very%20quickly%20noticed%20that%2C%20while%20easy%20and%20efficient%2C%20it%20has%20a%20flaw.%20You%20absolutely%20can%20NOT%20extend%20your%20elements%20" title="Google Bookmarks"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod&amp;source=Michael+Hartmayer+-+Portfolio+Have+a+Leet+Smoothy&amp;summary=Lately%20I%27ve%20been%20working%20with%20the%20marvelously%20easy%20to%20use%20and%20understand%20CSS%20framework%2C%20960%20Grid%20System.%20After%20getting%20started%20with%20it%2C%20I%20very%20quickly%20noticed%20that%2C%20while%20easy%20and%20efficient%2C%20it%20has%20a%20flaw.%20You%20absolutely%20can%20NOT%20extend%20your%20elements%20" title="LinkedIn"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod" title="Live"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;t=960gs%20Margin%20Mod" title="MySpace"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod" title="Reddit"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fcss%2F960gs-margin-mod%2F&amp;title=960gs%20Margin%20Mod" title="StumbleUpon"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelhartmayer.com/css/960gs-margin-mod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP LoadScript Class</title>
		<link>http://www.michaelhartmayer.com/php/php-loadscript-class/</link>
		<comments>http://www.michaelhartmayer.com/php/php-loadscript-class/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 03:46:16 +0000</pubDate>
		<dc:creator>Michael Hartmayer</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://www.michaelhartmayer.com/?p=289</guid>
		<description><![CDATA[This is a really handy class I wrote that loads all your scripts Server Side so that when your page loads there aren&#8217;t so many HTTP Requests. Useful if you&#8217;re trying to load 6 different js files and 4 different style sheets, or whatever. That&#8217;s 10 requests, completely gone. Just keep in mind that it [...]]]></description>
			<content:encoded><![CDATA[<p>This is a really handy class I wrote that loads all your scripts Server Side so that when your page loads there aren&#8217;t so many HTTP Requests. Useful if you&#8217;re trying to load 6 different js files and 4 different style sheets, or whatever. That&#8217;s 10 requests, completely gone. Just keep in mind that it dumps all your files straight into the html document- so, as long as you don&#8217;t have a problem with that, this is a great tool.</p>
<p>In addition, it&#8217;s really easy to add your own script types. Check out the script for details.</p>
<p>( Available At: <a title="PasteBin: LoadScript Class" rel="nofollow" href="http://pastebin.com/f5241789e" target="_blank">PasteBin: LoadScript Class</a> )</p>
<p>Usage:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
   <span style="color: #666666; font-style: italic;"># Include Class
</span>   <span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class.scriptloader.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Instantiate
</span>   <span style="color: #000088;">$jsLoader</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ScriptLoader<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'JS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Add Scripts
</span>   <span style="color: #000088;">$jsLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addScript</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my-javascript.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$jsLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addScript</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$jsLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addScript</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'other-scripts.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Dump into Document
</span>   <span style="color: #000088;">$jsLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">echoScripts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>On a quick note, it&#8217;d probably be a lot &#8216;neater&#8217; to mod-rewrite a php file to handle at least one request per script type. That way it doesn&#8217;t all get dumped straight into the page.</p>
<p>Something like:</p>
<p><em>RewriteRule ^script\.(.*)$ script-loader.php?type=$1 [L]</em></p>
<p>And for <strong>script-loader.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
   <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'js'</span><span style="color: #339933;">:</span>
         <span style="color: #666666; font-style: italic;">// Load all of the JavaScript files here</span>
         <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That way when you load something like <strong>script.js</strong> it will dump all of your java scripts into a &#8216;fake&#8217; file. Just make sure to use the default <em>$<span style="text-decoration: underline;">ScriptLoader</span>-&gt;type</em> (don&#8217;t set one when instantiating) if you are loading it from a <em>src=&#8221;foo.bar&#8221;</em>.</p>
<p>.. or something like that xD</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class&amp;bodytext=This%20is%20a%20really%20handy%20class%20I%20wrote%20that%20loads%20all%20your%20scripts%20Server%20Side%20so%20that%20when%20your%20page%20loads%20there%20aren%27t%20so%20many%20HTTP%20Requests.%20Useful%20if%20you%27re%20trying%20to%20load%206%20different%20js%20files%20and%204%20different%20style%20sheets%2C%20or%20whatever.%20That%27s%2010%20re" title="Digg"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F" title="Sphinn"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class&amp;notes=This%20is%20a%20really%20handy%20class%20I%20wrote%20that%20loads%20all%20your%20scripts%20Server%20Side%20so%20that%20when%20your%20page%20loads%20there%20aren%27t%20so%20many%20HTTP%20Requests.%20Useful%20if%20you%27re%20trying%20to%20load%206%20different%20js%20files%20and%204%20different%20style%20sheets%2C%20or%20whatever.%20That%27s%2010%20re" title="del.icio.us"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;t=PHP%20LoadScript%20Class" title="Facebook"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class" title="Mixx"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class&amp;annotation=This%20is%20a%20really%20handy%20class%20I%20wrote%20that%20loads%20all%20your%20scripts%20Server%20Side%20so%20that%20when%20your%20page%20loads%20there%20aren%27t%20so%20many%20HTTP%20Requests.%20Useful%20if%20you%27re%20trying%20to%20load%206%20different%20js%20files%20and%204%20different%20style%20sheets%2C%20or%20whatever.%20That%27s%2010%20re" title="Google Bookmarks"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class&amp;source=Michael+Hartmayer+-+Portfolio+Have+a+Leet+Smoothy&amp;summary=This%20is%20a%20really%20handy%20class%20I%20wrote%20that%20loads%20all%20your%20scripts%20Server%20Side%20so%20that%20when%20your%20page%20loads%20there%20aren%27t%20so%20many%20HTTP%20Requests.%20Useful%20if%20you%27re%20trying%20to%20load%206%20different%20js%20files%20and%204%20different%20style%20sheets%2C%20or%20whatever.%20That%27s%2010%20re" title="LinkedIn"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class" title="Live"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;t=PHP%20LoadScript%20Class" title="MySpace"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class" title="Reddit"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.michaelhartmayer.com%2Fphp%2Fphp-loadscript-class%2F&amp;title=PHP%20LoadScript%20Class" title="StumbleUpon"><img src="http://www.michaelhartmayer.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelhartmayer.com/php/php-loadscript-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
