<?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>Koodoz Design &#187; jquery</title>
	<atom:link href="http://www.koodoz.com.au/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.koodoz.com.au</link>
	<description>Koodoz Design is a creative design studio based in Richmond, Melbourne. We help businesses unleash their full potential through visual communication and clever design.</description>
	<lastBuildDate>Mon, 23 Jan 2012 03:40:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Newspaper Style Columns With (and Without) CSS3</title>
		<link>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/newspaper-style-columns-with-and-without-css3/</link>
		<comments>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/newspaper-style-columns-with-and-without-css3/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 03:34:04 +0000</pubDate>
		<dc:creator>Daniel Angel</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[newspaper]]></category>

		<guid isPermaLink="false">http://www.koodoz.com.au/?p=1346</guid>
		<description><![CDATA[

One of the coolest features of CSS3 is the ability &#8230;]]></description>
			<content:encoded><![CDATA[<img src="http://www.koodoz.com.au/wp-content/uploads/2009/08/columns.jpg" alt="Newspaper" title="columns" width="300" height="293" class="size-full wp-image-1416" style="margin-bottom: 40px;" />

<p>One of the coolest features of CSS3 is the ability to create newspaper-like columns on your layouts without any extra markup. We always find ourselves &#8220;cheating&#8221;, using things like <code>&lt;div id=&quot;column-one&quot;&gt;</code> which is not very good, so this property would save us a lot of time and unnecessary code.</p>

<p>CSS3 solves all this with the use of some really cool properties: <code>column-width</code>, <code>column-gap</code> and <code>column-rule</code>. I guess they&#8217;re pretty self explanatory, except for <code>column-rule</code> which basically behaves like a border in between columns, so it can be treated like one, using width, style, etc. If you need more details, you can <a href="http://www.w3.org/TR/css3-multicol/" rel="external">go to the source</a>.<span id="more-1346"></span><p>

<p>The problem? you guessed it! It&#8217;s still not supported by some browsers, namely IE and Opera (need to check IE8 and Chrome, though). Anyway, for this blog post I decided to start testing cross-browser solutions for the problem and this is what I&#8217;ve come up with so far.</p>

<p>First, we use the property for the browsers that support it, so if we have something like:</p>

<p>
<pre>
&lt;div id=&quot;content&quot;&gt;
&lt;p&gt;The quick brown fox jumped over the lazy dog&lt;/p&gt;
&hellip;
&lt;p&gt;And they lived happily everafter&lt;/p&gt;
&lt;/div&gt;
</pre>
</p>

<p>we then style it like this:</p>

<p>
<pre>
div#content {
	-moz-column-count: 4;
	-webkit-column-count: 4;
}
</pre>
</p>

<p>Notice the prefixes <code>-moz</code> and <code>-webkit</code>. The reason for their presence lies in the fact that amazingly enough, the specification is still a draft (it was originally suggested in 2004!), so we need those. They&#8217;re obviously not 100% standard but in this case I would favour common sense as opposed to standards compliance. The styles themselves can get immensely fancier, using the <code>column-gap</code> and <code>column-rule</code> properties, but let&#8217;s keep it simple for the purposes of this post.</p>

<p>If you use a decent browser and look at that code, you should see something like this:</p>

<img src="http://www.koodoz.com.au/wp-content/uploads/2009/08/columns-01.jpg" alt="Demonstration of CSS columns on decent browsers" title="columns-01" width="540" height="239" class="size-full wp-image-1405 center" />

<p>Everyone else should see the style-less rendering:</p>

<img src="http://www.koodoz.com.au/wp-content/uploads/2009/08/columns-02.jpg" alt="Document without columns styling" title="columns-02" width="540" height="176" class="size-full wp-image-1407 center" />

<h3>Taking care of all other browsers</h3>

<p>So, to make sure no one else misses out on the fun, we can use a little jQuery. There are many jQuery plugins to deal with multi-columns, but <a href="http://www.systemantics.net/en/columnize" rel="external">Systemantics&#8217; columnize</a> plugin was the best-suited one I could find, so cheers to them!</p>

<p>We don&#8217;t want to apply the columnize styles to the browsers that support <code>column-width</code>, so we need to serve the javascript only to those that absolutely need it. You can do so by using jQuery&#8217;s browser detection, but I would suggest using <code><a href="/klog/development/getting-phps-get_browser-function-to-work-on-your-site/">get_browser()</a></code> instead. It gives you much more control:</p>

<p>
<pre>
&lt;?php if ( ($browser != &#039;Firefox&#039;) &amp;&amp; ($browser != &#039;Safari&#039;) ) { ?&gt;	
	// enter columnize code here
&lt;?php } ?&gt;
</pre>
</p>

<p>Using columnize is pretty straightforward. You invoke jquery and the plugin, and then simply do something like:</p>

<p>
<pre>
$(&quot;#content&quot;).columnize({columns: 4});
</pre>
</p>

<p>By default, columnize adds the class <code>.column</code> to each of the generated columns, so be sure to style it properly. The overall width of each element should be equal to the width of the parent element, divided by the number of columns, so for instance, if your parent element is 1200px wide and you have four columns, the overall width of each <code>.column</code> element should be 300px. Columnize has tons of other options as well, so be sure to check them out.<p>

<p>You can <a href="/demos/css-columns/">look at the demonstration here</a>. As usual, comments and questions are always welcome. Thanks for reading!</p>]]></content:encoded>
			<wfw:commentRss>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/newspaper-style-columns-with-and-without-css3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SitePrep raises the bar!</title>
		<link>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/siteprep-raises-the-bar/</link>
		<comments>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/siteprep-raises-the-bar/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 06:09:35 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sifr]]></category>
		<category><![CDATA[siteprep]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.koodoz.com.au/blog/?p=141</guid>
		<description><![CDATA[

Our latest creation, which you can see at www.siteprep.com.au has &#8230;]]></description>
			<content:encoded><![CDATA[<a href="http://koodoz.com.au/wp-content/uploads/2008/11/picture-11.png"><img src="http://www.koodoz.com.au/wp-content/uploads/2008/11/picture-11-300x248.png" alt="Screenshot of www.siteprep.com.au" title="SitePrep" width="300" height="248" class="size-medium wp-image-142" /></a>

Our latest creation, which you can see at <a href="http://www.siteprep.com.au">www.siteprep.com.au</a> has raised the bar on existing and future designs by using a range of the latest in web development technologies including CSS, JQuery, sIFR and Ajax to create a beautifully simple and visually unique interface. <span id="more-141"></span>


<blockquote><em>SitePrep specialises in fine grading indoor and outdoor surfaces using laser technology for absolute precision. The company was formed in 2000 and has provided service to the building, landscape and construction industry in the areas of earthworks.</em></blockquote>]]></content:encoded>
			<wfw:commentRss>http://www.koodoz.com.au/klog/web-design-html-xhtml-css-cascading-style-sheets-hyper-text-markup-language-javascript-flash-php/siteprep-raises-the-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

