<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Musings of ErisDS</title>
	
	<link>http://erisds.co.uk</link>
	<description>Web development, Symfony, Wordpress and general geekery</description>
	<lastBuildDate>Sun, 18 Oct 2009 19:54:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/erisds" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>It’s been a Very Quiet Month…</title>
		<link>http://erisds.co.uk/general/its-been-a-very-quiet-month</link>
		<comments>http://erisds.co.uk/general/its-been-a-very-quiet-month#comments</comments>
		<pubDate>Wed, 16 Sep 2009 20:27:47 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=827</guid>
		<description><![CDATA[It's now been over a month since my last post to this blog. I had promised not to ever let it get longer than 10 days but this past month has been an exceptional circumstance. I've had a few enquiries regarding part 3 of my YUI articles, so this post is just a quick update to say it's still on it's way!


Related posts:<ol><li><a href='http://erisds.co.uk/general/2009-review-and-aims-part-ii' rel='bookmark' title='Permanent Link: 2009 Review and Aims Part II'>2009 Review and Aims Part II</a> <small>On the first of June I published a summary of...</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s now been over a month since my last post to this blog. I had promised not to ever let it get longer than 10 days, but this past month has been an exceptional circumstance. I&#8217;ve had a few enquiries regarding part 3 of my YUI Carousel article series, so this post is just a quick update to say it&#8217;s still on it&#8217;s way!</p>
<p>As <a href="http://erisds.co.uk/internet/my-web-hosting-nightmare">my last post explained</a>, I&#8217;ve had my house rewired and since redecorated. I had to pack my computer up in a box for 3 weeks (shock horror) whilst this was done, meaning I had little access to work on my blog articles. Since the redecorating has been finished I have had a lot of joint pain, and have now been diagnosed with Inflammatory Arthritis. This means that the amount of typing I can do in a day is governed by the pain in my hands :(</p>
<p>However I do have some bits of good news! Firstly, YUI Javascript Carousel Part 3 is in the works and should be published in a few days. Secondly, Part 3 was going to be the last article in the series but I now also have material for a fourth, and potentially a fifth article. Finally, I will shortly be receiving a copy of the forthcoming Symfony book &#8220;Symfony 1.3 Web Application Development&#8221; which I will reviewing along with some potential goodies!</p>
<p>In summary, there is plenty of good stuff in the works, but it&#8217;s unfortunately taking me longer to get it done. So please bare with me and keep watching this space!</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/general/2009-review-and-aims-part-ii' rel='bookmark' title='Permanent Link: 2009 Review and Aims Part II'>2009 Review and Aims Part II</a> <small>On the first of June I published a summary of...</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/general/its-been-a-very-quiet-month/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Web Hosting Nightmare…</title>
		<link>http://erisds.co.uk/internet/my-web-hosting-nightmare</link>
		<comments>http://erisds.co.uk/internet/my-web-hosting-nightmare#comments</comments>
		<pubDate>Fri, 14 Aug 2009 21:05:56 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=797</guid>
		<description><![CDATA[This past week and a half I have "moved home" in more ways than one. Not only have I had to move EVERYTHING out of the house we bought 8 months ago so that electricians can re-wire the entire place, but I have also moved this blog to a new home with <a href="http://hosting.peartreeuk.com/" target="_blank">PeartreeUK</a>. The result is I have been unbelievably busy, have no electricity at home (or sofa, or bed) and the 3rd part of my <a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1" target="_blank">YUI: Javascript Carousel</a> series has been delayed.

<h2>Web Hosting is a minefield...</h2>
Seeing the web hosting feature in the latest edition of <a href="http://www.netmag.co.uk/" target="_blank"><strong>.net Magazine</strong></a> has confirmed my feelings about the web hosting industry: it's a minefield. A completely over saturated market of small-fry &#38; big brands, most of which you will never have heard of unless you've heard a horror story or two. In my experience it doesn't seem to matter where you turn, something unexpected goes wrong.

..last weekend I  decided to finally sort out my hosting life. With all my resold accounts still hanging around on slowly-slowly-Surpass, and my blog on clunky-Clook, I've turned back to the one place I know I'll get what I pay for - <a href="http://hosting.peartreeuk.com/" target="_blank">PearTreeUK</a>. They may be relatively small, but there's nothing like being able to get hold of an <strong>intelligent human being</strong> whenever you need one! Having kept my original account open as a test bed, I have now upgraded to a reseller with them.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims-part-ii' rel='bookmark' title='Permanent Link: 2009 Review and Aims Part II'>2009 Review and Aims Part II</a> <small>On the first of June I published a summary of...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This past week and a half I have &#8220;moved home&#8221; in more ways than one. Not only have I had to move EVERYTHING out of the house we bought 8 months ago so that electricians can re-wire the entire place, but I have also moved this blog to a new home with <a href="http://hosting.peartreeuk.com/" target="_blank">PeartreeUK</a>. The result is I have been unbelievably busy, have no electricity at home (or sofa, or bed) and the 3rd part of my <a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1" target="_blank">YUI: Javascript Carousel</a> series has been delayed.</p>
<h2>Web Hosting is a minefield&#8230;</h2>
<p>Seeing the web hosting feature in the latest edition of <a href="http://www.netmag.co.uk/" target="_blank"><strong>.net Magazine</strong></a> has confirmed my feelings about the web hosting industry: it&#8217;s a minefield. A completely over saturated market of small-fry &amp; big brands, most of which you will never have heard of unless you&#8217;ve heard a horror story or two. In my experience it doesn&#8217;t seem to matter where you turn, something unexpected goes wrong.</p>
<p>For years I was a happy client of <strong>Lonex</strong>. Their support was good enough although there was no status page, the servers were reliable, and generally things went ok. Then they got <strong>DDoSed </strong>and never recovered &#8211; my sites suffered <strong>downtime</strong> a few times a week, everything was <strong>slow</strong>, and I couldn&#8217;t get support to acknowledge or fix the problem.</p>
<p>So I moved to <strong>Surpass</strong>: a seemingly huge company with a public community, status pages, good support, and reliable service. Then I started work on this blog and found the <strong>pages loaded really slowly</strong>. I queried this and after ages of back and forth with support I got a message which simply read: <em>&#8220;Thanks for your patience. We have completed some work on this server and performance is back to normal. Thanks for hanging in there.&#8221;</em> &#8211; Nothing had changed as far as I was concerned.</p>
<p>Next I opened a single account on <a href="http://hosting.peartreeuk.com/">PeartreeUK</a> and started prepping my blog for launch. For some reason I couldn&#8217;t get <strong>Wordpress</strong> to work properly. In my frustration I gave up without giving them a chance and tried yet another company.</p>
<p>This time it was <strong>Clook</strong>. A more expensive company but they had good reviews from friends so I figured I&#8217;d get what I paid for. My blog had the same Wordpress problems  &amp; I realised it was entirely my fault. So I got it all fixed and launched my blog on<strong> Clook.</strong></p>
<p>4 months later and I have two niggles with <strong>Clook</strong>:</p>
<ol>
<li> Because Apache is running as &#8220;noone&#8221; PHP scripts create files that I can&#8217;t delete through FTP. There is no way to remove the files through the control panel so I have had to install a PHP File manager which I really don&#8217;t like. It just makes my life far more complicated than it needs to be, especially when trying to work with a publishing platform like <strong>Wordpress</strong>.</li>
<li>For some reason there is no way to setup recurring payments. I have to remember to pay my bill each month. Yet again just something dumb that makes my life harder than it needs to be.</li>
</ol>
<h2>PeartreeUK &#8211; my Web Hosting Solution</h2>
<p>So last weekend I  decided to finally sort out my hosting life. With all my resold accounts still hanging around on slowly-slowly-Surpass, and my blog on clunky-Clook, I&#8217;ve turned back to the one place I know I&#8217;ll get what I pay for &#8211; <a href="http://hosting.peartreeuk.com/" target="_blank">PearTreeUK</a>. They may be relatively small, but there&#8217;s nothing like being able to get hold of an <strong>intelligent human being</strong> whenever you need one! Having kept my original account open as a test bed, I have now upgraded to a reseller with them.</p>
<p>I doubt you will find better customer service than <a href="http://hosting.peartreeuk.com/" target="_blank">PeartreeUK&#8217;s</a> -  having one person consistently deal with you from day one means that you are always taken care of without the frustration of trying to explain yourself AGAIN everytime there&#8217;s a shift-change. If you&#8217;ve visited here before you may notice how much faster pages (and FTP) now loads &#8211; my Wordpress backend feels like it&#8217;s on speed. Add to that their prices &amp; the excellent attitude of their employees and you have a value-for-money service that I <strong>highly recommend</strong>.</p>
<p class="small"><strong>Note:</strong> Expect an update post in 6 months documenting my experiences with Peartree!</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims-part-ii' rel='bookmark' title='Permanent Link: 2009 Review and Aims Part II'>2009 Review and Aims Part II</a> <small>On the first of June I published a summary of...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/internet/my-web-hosting-nightmare/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>YUI: Javascript Carousel with Custom Navigation – Part 2</title>
		<link>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2</link>
		<comments>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:28:07 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=692</guid>
		<description><![CDATA[<a href="http://erisds.co.uk/resources/yui-carousel-demo-2"><img src="http://erisds.co.uk/wp-content/uploads/2009/08/carousel-2.jpg" alt="YUI Carousel Example  2" title="YUI Carousel Example 2" width="350" height="257" class="alignleft size-full wp-image-749" /></a>Welcome to <strong>Part 2</strong> of my YUI Carousel series. If you haven't read it, <a href="http://erisds.co.uk/code/yui-javscript-carousel-custom-navigation-part-1">Part 1 is here</a>. <strong>Part 2</strong> uses class names to setup multiple carousel instances, and also drops the YUI CSS in favour of writing your own custom css. The final <strong>Part 3</strong> will show you how to write your own completely custom navigation for the carousel.

If you haven't already read the first part of this tutorial, I suggest that you do. If you want to follow along, then please setup your workspace with a basic HTML file and somewhere to put Javascript, CSS &#038; images now, <a href="http://erisds.co.uk/resources/yui-carousel-demo-2">the demonstration page is here</a> . I'll be using the same images as last time, same rules apply! 


Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 1'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 1</a> <small>Welcome to my first JavaScript related post! I'm currently in...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://erisds.co.uk/resources/yui-carousel-demo-2"><img src="http://erisds.co.uk/wp-content/uploads/2009/08/carousel-2.jpg" alt="YUI Carousel Example  2" title="YUI Carousel Example 2" width="350" height="257" class="alignleft size-full wp-image-749" /></a>Welcome to <strong>Part 2</strong> of my YUI Carousel series. This part uses class names to setup multiple carousel instances, and also drops the YUI CSS in favour of writing your own custom css. The final <strong>Part 3</strong> will show you how to ditch the YUI navigation completely, so that you can use custom labels.</p>
<p>I recommend that you read <a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1"><strong>Part 1</strong></a> of this tutorial if you haven&#8217;t already. If you want to follow along, then please setup your workspace with a basic HTML file and somewhere to put Javascript, CSS &#038; images now, <a href="http://erisds.co.uk/resources/yui-carousel-demo-2">the demonstration page is here</a>. I&#8217;ll be using the same images as last time, same rules apply! </p>
<h2>Getting Started &#8211; The HTML</h2>
<p>The HTML for the carousel is the same as in <a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1">Part 1</a>, except this time I have added titles to my images. Below I&#8217;ve only listed one carousel, but as you can see on the <a href="http://erisds.co.uk/resources/yui-carousel-demo-2">demonstration page</a>, the setup JavaScript we&#8217;ll be writing later will detect multiple carousels on the page. To add another carousel just copy the HTML structure including the container div, change the id&#8217;s but leave the classes intact.</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;carousel&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;my-carousel&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;carousel-container&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;carousel-content&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm3.static.flickr.com/2181/3529457733_50200b99ab.jpg&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Baby Dolphin&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span>A Baby Dolphin called Bob<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm4.static.flickr.com/3543/3514480796_2243d70d6b.jpg&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span><span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Birds&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span>Feeding the birds<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm4.static.flickr.com/3306/3503294318_c34fab9d17.jpg&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tiger&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span>Up close and personal with a tiger<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h2>Referencing YUI</h2>
<p>You&#8217;ll need to add the same JavaScript references right above your closing body tag as last time. That is the link to the combined YUI scripts, plus your own setup JavaScript file. This time though, <strong>DON&#8217;T</strong> include the YUI CSS, just add a link to your own CSS file at the top of the page. So these are the includes you should have:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/carousel.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Content here --&gt;</span><br />
<br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&amp;amp;2.7.0/build/element/element-min.js&amp;amp;2.7.0/build/animation/animation-min.js&amp;amp;2.7.0/build/carousel/carousel-min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/carousel.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h2>Setting up &#8211; Javascript</h2>
<h3>Step 1 &#8211; Locate all carousel markup on the page</h3>
<p>The first step is the same as last time, to setup our namespace and object literal. We still need an <kbd>init</kbd> function, and inside it we use the <kbd>getElementsByClassName</kbd> function to populate our <kbd>carousels</kbd> property with an array of all the elements which have the class <kbd>carousel-container</kbd>. We then loop over carousels and call a <kbd>setup</kbd> function on each element.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">YAHOO.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ErisDS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
YAHOO.<span style="color: #660066;">ErisDS</span>.<span style="color: #660066;">Carousel</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; carousels<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span><br />
&nbsp; init<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousels</span> <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">getElementsByClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'carousel-container'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousels</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setup</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousels</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> ...</div></td></tr></tbody></table></div>
<h3>Step 2 &#8211; Turn carousel markup into working carousels</h3>
<p>Now we need to write our <kbd>setup</kbd> function. It takes the element that is to be a carousel as an argument. The body of the function contains the same setup code as our original <kbd>init</kbd> function from <a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1">Part 1</a>, where the settings are explained.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; setup<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>carousel_el<span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> carousel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> YAHOO.<span style="color: #660066;">widget</span>.<span style="color: #660066;">Carousel</span><span style="color: #009900;">&#40;</span>carousel_el<span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; autoPlayInterval<span style="color: #339933;">:</span> 5000<span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; isCircular<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; animation<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> 1.0<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; numVisible<span style="color: #339933;">:</span> 1<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; carousel.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; carousel.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <br />
&nbsp; &nbsp; carousel.<span style="color: #660066;">startAutoPlay</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
</p>
<p>Finally, don&#8217;t forget to call the function using <kbd>onDOMReady()</kbd>.</p>
<p></code></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">onDOMReady</span><span style="color: #009900;">&#40;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">ErisDS</span>.<span style="color: #660066;">Carousel</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h2>Styling up - The Custom CSS</h2>
</p>
<p>This time we aren't going to use the YUI CSS at all, so we will need to do quite a bit of work ourselves. First up I'll show you the bare minimum needed to get the carousel working. Then we will go through styling the navigation, and finally the customisations to get it looking the same as the demo page.</p>
<h3>The Bare Minimum</h3>
<p>To get the carousel working horizontally, we need to get all the items to display side-by-side. We then need to hide all but the item that should be visible using <kbd>overflow:hidden</kbd>. We also need to clear margins and padding, but we don't need to set any width or height - the carousel will just resize to fit the largest element inside of it.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.carousel</span> .carousel-container<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">32000px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span> li<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #00AA00;">*</span>zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p><img src="http://erisds.co.uk/wp-content/uploads/2009/08/carousel-plain.jpg" alt="Carousel Plain" title="Carousel Plain" width="300" height="330" class="alignright size-full wp-image-741" /></p>
<p>I can hear people all over the interweb screaming "nooooo!" at the IE hacks. Feel free to move these to <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a>, but for the purpose of tutorials using hacks makes it easier to show what I'm doing! All that extra code (plus the <kbd>position:relative</kbd>'s) is used to get IE6 &#038; 7 to display the items side-by-side whilst still hiding all but the first item.</p>
<p>On the right you can see how the carousel looks with just this basic styling - pretty nasty! Time to get creative. I want to get rid of the text in the navigation, put the navigation at the bottom, and add some nicer buttons<strong>*</strong>.</p>
<h3>The Navigation</h3>
<p>Because I want to put the navigation at the bottom &#038; have my carousel be fixed size, I need to set <kbd>width</kbd> and <kbd>height</kbd> on <kbd>carousel-container</kbd> and on the content <kbd>li</kbd>. I'm also going to add a <kbd>border</kbd> to contain the carousel. The following is the extra CSS I added.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.carousel</span> .carousel-container<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">364px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#451669</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span> li<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">364px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>The following code uses <kbd>position:absolute</kbd> to move the navigation to the bottom. I've also added a semi-transparent background to the navigation bar, and used the <kbd>inline-block</kbd> hack again to get the <kbd>UL</kbd> to sit in the middle for all browsers. In the second part I have turned the navigation into circles using the CSS3 <kbd>border-radius</kbd> property (IE users will see squares) &#038; gotten rid of the text with positioning.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.carousel</span> .yui-carousel-nav<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">300</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/bg.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">repeat</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span><br />
&nbsp; zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">middle</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul li<span style="color: #00AA00;">&#123;</span> &nbsp;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#673191</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#673191</span><span style="color: #00AA00;">;</span><br />
&nbsp; -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul li a<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-10000px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul li<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul li<span style="color: #6666ff;">.hover</span><span style="color: #00AA00;">,</span> <br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> ul li<span style="color: #6666ff;">.yui-carousel-nav-page-selected</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#b6a2c4</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Next let's replace those ugly buttons with something else. By setting the <kbd>width</kbd>, <kbd>height</kbd> and <kbd>padding</kbd> of the <kbd>button</kbd> we can hide it. Then I've added a background image to the <kbd>span</kbd>s and absolutely positioned them. I have also been adding hover states to all the navigation, but at the moment these will only work in browsers that support the <kbd>:hover</kbd> psuedo class on elements other than the <kbd>anchor</kbd> tag.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span button<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#carousel-2</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span button<span style="color: #3333ff;">:focus</span><span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> 0 <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span.yui-carousel-first-button<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">170px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/prev-arrow.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span.yui-carousel-next-button<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">170px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/next-arrow.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span<span style="color: #6666ff;">.yui-carousel-first-button</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span><br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span.prev-hover<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/prev-arrow-hover.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span<span style="color: #6666ff;">.yui-carousel-next-button</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span><br />
<span style="color: #6666ff;">.carousel</span> <span style="color: #6666ff;">.yui-carousel-nav</span> span.next-hover<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/next-arrow-hover.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>We can fix the hover states for the previous and next buttons with some Javascript, but I haven't found a way to get this to work for the list navigation yet as it gets rewritten everytime the carousel changes and therefore it loses the listeners. To add listeners to the buttons, first add the following code to the end of your <kbd>init</kbd> function.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> nav_buttons <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">getElementsByClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'yui-carousel-button'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>nav_buttons<span style="color: #339933;">,</span><span style="color: #3366CC;">'mouseover'</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">mouseover</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>nav_buttons<span style="color: #339933;">,</span><span style="color: #3366CC;">'mouseout'</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">mouseout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Next, after the setup function add a comma, and then add the following two functions. All this does is add a <kbd>class</kbd> on mouseover and then remove it on mouseout, we use two different classes to make it easier to reference the buttons in IE6. This could be replaced with a sprite image &#038; CSS that just changes the background position.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; mouseover<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> add_target <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">getTarget</span><span style="color: #009900;">&#40;</span>e<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//add_target = YAHOO.util.Dom.getAncestorByTagName(target,'span');</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span>add_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'yui-carousel-next-button'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span>add_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'next-hover'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span>add_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'yui-carousel-first-button'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span>add_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'prev-hover'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; mouseout<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> rem_target <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">getTarget</span><span style="color: #009900;">&#40;</span>e<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//rem_target = YAHOO.util.Dom.getAncestorByTagName(target,'span');</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span>rem_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'next-hover'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span>rem_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'next-hover'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span>rem_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">'prev-hover'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span>rem_target<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;prev-hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h3>Headings</h3>
<p>That's it for the functionaliy. Here's the CSS I used to style my main heading. It's almost identical to the nav-bar code.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span> li h2<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">300</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">28px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/bg.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">repeat</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p><a href="http://erisds.co.uk/resources/yui-carousel-demo-2">On the demo page</a>, the two carousels are the same size and styled very similarly. However this is not necessary as you do not need to specifiy the size (the carousel will default to the size of the largest item within it) and you can also use <kbd>id</kbd>'s to style the two carousels entirely differently in the CSS, yet still use the same Javascript to make them work. However the functionality for the two carousels would remain the same.</p>
<p>Well I think that's a wrap!  Not every single bit of CSS I used is here, but I will be providing all my files which I publish <strong>Part 3</strong> next week some time. Hope you've found this useful &#038; reasonably easy to follow. Please drop any suggestions or ideas in the comments!</p>
<p class="small"><strong>*</strong> I said nicer, not amazing... I'm no designer!!</p>
<h3>Resources</h3>
<ul>
<li><a href="http://developer.yahoo.com/yui/docs/YAHOO.widget.Carousel.html">Visit the API for a full list of available methods, properties and attributes.</a></li>
<li><a title="YUI Dependency Configurator" href="http://developer.yahoo.com/yui/articles/hosting/">YUI Dependency Configurator</a></li>
<li><a href="http://erisds.co.uk/resources/yui-carousel-demo-2">The demo page (2)</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 1'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 1</a> <small>Welcome to my first JavaScript related post! I'm currently in...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>YUI: Javascript Carousel with Custom Navigation – Part 1</title>
		<link>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1</link>
		<comments>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1#comments</comments>
		<pubDate>Tue, 28 Jul 2009 12:22:50 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=501</guid>
		<description><![CDATA[<a href="http://erisds.co.uk/resources/yui-carousel-demo-i"><img class="alignleft size-full wp-image-675" title="Carousel 1" src="http://erisds.co.uk/wp-content/uploads/2009/07/carousel.jpg" alt="Carousel 1" width="350" height="254" /></a>Welcome to my first JavaScript related post! I'm currently in the process of both learning *proper* JavaScript and trying to get to grips with the YUI framework. If you have suggestions for how to improve the following code I'd love to hear them.

The YUI Carousel widget is currently in Beta, and the navigation that it generates is very basic and, unlike the rest of the YUI framework, doesn't have the necessary CSS hooks to style it properly. This may change with the release of YUI 3.0, but the Carousel widget isn't included yet. So for the time being this <strong>three-part series</strong> will show you how to setup a Carousel &#38; build custom navigation.


Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 2'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 2</a> <small>Welcome to Part 2 of my YUI Carousel series. If...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://erisds.co.uk/resources/yui-carousel-demo-1"><img class="alignleft size-full wp-image-675" title="Carousel 1" src="http://erisds.co.uk/wp-content/uploads/2009/07/carousel.jpg" alt="Carousel 1" width="350" height="254" /></a>Welcome to my first JavaScript related post! I&#8217;m currently in the process of both learning *proper* JavaScript and trying to get to grips with the YUI framework. If you have suggestions for how to improve the following code I&#8217;d love to hear them.</p>
<p>The YUI Carousel widget is currently in Beta, and the navigation that it generates is very basic and, unlike the rest of the YUI framework, doesn&#8217;t have the necessary CSS hooks to style it properly. This may change with the release of YUI 3.0, but the Carousel widget isn&#8217;t included yet. So for the time being this <strong>three-part series</strong> will show you how to setup a Carousel &amp; build custom navigation.</p>
<p><strong>Part 1</strong> will go through the HTML, CSS &amp; Javascript needed to setup a basic carousel using the YUI default skin. In <strong><a href="http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2">Part 2</a></strong> we&#8217;ll remove the YUI skin and write our own, introduce multiple instances via class names and do some customisation to the carousel. Finally, in <strong>Part 3</strong> I&#8217;ll go through all of the Javascript needed to write your own, completely custom navigation for the carousel.</p>
<h2>Getting Started &#8211; The HTML</h2>
<p>If you want to follow along, then setup your workspace with a basic HTML file and somewhere to put Javascript, CSS &amp; images now. I&#8217;ll be using some photos from my recent holiday, feel free to use these images for testing purposes, but please don&#8217;t publish them as your own work! If you want to see the finished carousel in action, then please check out <a href="http://erisds.co.uk/resources/yui-carousel-demo-1">the demonstration page</a>.</p>
<p>First we need to create the HTML list &amp; containers for our carousel along with some CSS classes for both reference and styling. This should include a container <kbd>&lt;div&gt;</kbd> (with class <kbd>carousel-container</kbd>) and an ordered list to contain our carousel items (class <kbd>carousel-content</kbd>). I have also added the classes <kbd>yui-skin-sam</kbd> and <kbd>carousel</kbd> to the body tag. Apart from those prefixed with &#8220;yui&#8221; all the classes I&#8217;m using are my own conventions and are not required by YUI.</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;yui-skin-sam carousel&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;my-carousel&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;carousel-container&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;carousel-content&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm4.static.flickr.com/3543/3514480796_2243d70d6b.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Birds&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm4.static.flickr.com/3306/3503294318_c34fab9d17.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tiger&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://farm4.static.flickr.com/3583/3530272148_4902b92aee.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zebra&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;364&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>The <kbd>yui-skin-sam</kbd> class is a reference point for the YUI CSS so that the styling can be applied. For now I have added just three items to the list, and each one contains only an image. You can also include headers, paragraphs and any other HTML content to your carousel.</p>
<h2>Referencing YUI</h2>
<p>To turn our numbered list of images into a carousel we need to include reference to the YUI CSS and Javascript. Unlike many other frameworks, rather than downloading a local copy of the framework, it is normal to reference YUI direct from the Yahoo! Servers using the <a title="YUI Dependency Configurator" href="http://developer.yahoo.com/yui/articles/hosting/">YUI Dependency Configurator</a> to work out which files you need. For now I will show you which files to add:</p>
<p>We are going to need the carousel.css file to style the list properly. Add the following stylesheet link to the head of your HTML file.</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yui.yahooapis.com/combo?2.7.0/build/carousel/assets/skins/sam/carousel.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></td></tr></tbody></table></div>
<p>In order for the Carousel to work properly, we will need the YUI Dom collection &amp; Event utilities, the Element utility (which provides an object to represent HTML elements), the animation utility and finally, the carousel component. They are minimised and combined by YUI and served to you as a single file. YUI is an unobtrusive framework, so add the following lines of HTML to the very bottom of your page just above the <kbd>&lt;/body&gt;</kbd> tag.</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&amp;amp;2.7.0/build/element/element-min.js&amp;amp;2.7.0/build/animation/animation-min.js&amp;amp;2.7.0/build/carousel/carousel-min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h2>Setting up &#8211; Javascript</h2>
<p>Now with all of the framework components in place, we can go about the work of setting up our carousel. For now we will do this by getting the id of the carousel&#8217;s wrapping <kbd>&lt;div&gt;</kbd>, but in <strong>Part II</strong> we will create the carousel based on class name so that we might have multiple instances. </p>
<p>Create a file called carousel.js in a Javascript folder, and link to it after the YUI scripts so it appears something like this:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/carousel.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>Be aware that we create an instance of the carousel by passing in the <strong>id of the containing <kbd>&lt;div&gt;</kbd></strong>, not the ordered list. We also need to pass in a set of properties which are explained below. I have made our carousel variable into a property of our object so that we can easily have reference from additional methods of our object when we add more functionality later.</p>
<p>Once we have setup our carousel instance, we call <kbd>render</kbd>, <kbd>show</kbd>, and <kbd>startAutoPlay</kbd> to setup, display &amp; start the carousel. Of course none of this happens until the <kbd>init</kbd> method is called. As YUI is non-intrusive the methods to setup the carousel are called after the page has finished loading using <kbd>onDomReady</kbd>. I have added a test to the <kbd>onDomReady</kbd> function to ensure that the carousel id exists before we try using it to create an instance of the carousel widget.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">//Setup a namespace to contain your own code within the YAHOO namespace</span><br />
YAHOO.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ErisDS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//Create our carousel object literal with an init method</span><br />
YAHOO.<span style="color: #660066;">ErisDS</span>.<span style="color: #660066;">Carousel</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; carousel<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span><br />
&nbsp; init<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousel</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> YAHOO.<span style="color: #660066;">widget</span>.<span style="color: #660066;">Carousel</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;my-carousel&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; autoPlayInterval<span style="color: #339933;">:</span> 5000<span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; isCircular<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; animation<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> 0.5<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; numVisible<span style="color: #339933;">:</span> 1<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousel</span>.<span style="color: #660066;">render</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;">this</span>.<span style="color: #660066;">carousel</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #006600; font-style: italic;">// display the widget</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">carousel</span>.<span style="color: #660066;">startAutoPlay</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//onDomReady check to see if our carousel exists, and call the setup function</span><br />
YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">onDOMReady</span><span style="color: #009900;">&#40;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;my-carousel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; YAHOO.<span style="color: #660066;">ErisDS</span>.<span style="color: #660066;">Carousel</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Copy the code above into your Javascript file. You should now have a working carousel.</p>
<h3>The Properties</h3>
<dl>
<dt>autoPlayInterval: 5000</dt>
<dd>How many milliseconds between transitions (i.e. 5 seconds)</dd>
<dt>isCircular: true </dt>
<dd>Previous &amp; next button are always active as when the carousel gets to the last item it carries on back to the first.</dd>
<dt>animation: { speed: 1.0 }</dt>
<dd>How long it takes for a transition from one item to the next to complete. 1.0 is one second.</dd>
<dt>numVisible: 1 </dt>
<dd>How many items are visible at any one time.</dd>
</dl>
<p><strong>Note:</strong> The configuration attribute used to make the YUI Carousel autoplay changed somewhere between YUI 2.6 &amp; 2.7 from <kbd>autoPlay</kbd>, to <kbd>autoPlayInterval</kbd>. It works the same way, but there is no backwards compatibility.</p>
<h2>Tidying up &#8211; A little Custom CSS</h2>
<p>Depending on your browser and any other CSS you have present on the page your carousel may have some spacing which makes it look untidy. The following CSS is designed to ensure the carousel fits snug around the images and looks smart.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#my-carousel</span> .carousel-container<span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">364px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #cc00cc;">#my-carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #cc00cc;">#my-carousel</span> ol.carousel-<span style="color: #000000; font-weight: bold;">content</span> li<span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">364px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>The <a href="http://erisds.co.uk/resources/yui-carousel-demo-i">finished article is basically an image slideshow</a>.  In the next part we will drop the YUI CSS and customise the carousel and navigation. If you have had any problems following this tutorial or ended up with a different result, please drop me a comment and I&#8217;ll try to help out.</p>
<h3>Resources</h3>
<ul>
<li><a href="http://developer.yahoo.com/yui/docs/YAHOO.widget.Carousel.html">Visit the API for a full list of available methods, properties and attributes.</a></li>
<li><a title="YUI Dependency Configurator" href="http://developer.yahoo.com/yui/articles/hosting/">YUI Dependency Configurator</a></li>
<li><a href="http://erisds.co.uk/resources/yui-carousel-demo-1">The demo page (1)</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-2' rel='bookmark' title='Permanent Link: YUI: Javascript Carousel with Custom Navigation &#8211; Part 2'>YUI: Javascript Carousel with Custom Navigation &#8211; Part 2</a> <small>Welcome to Part 2 of my YUI Carousel series. If...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/code/yui-javascript-carousel-custom-navigation-part-1/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Symfony: New Static Text Management Plugin</title>
		<link>http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin</link>
		<comments>http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin#comments</comments>
		<pubDate>Wed, 15 Jul 2009 12:59:22 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=626</guid>
		<description><![CDATA[Generally, when I find something interesting I use twitter &#038; delicious to spread the word, but this morning something in my RSS Reader got me excited enough to decide to write a blog post. Thomas Rabaix has hit the nail on the head with his latest offering: <a href="http://rabaix.net/en/articles/2009/07/14/wording-is-not-a-developer-job-">Wording is not a developer job</a>. Not only with his underlying premise, but also with the solution he has developed and offered to the world.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/symfony/snippet-symfony-user-access-the-user-object' rel='bookmark' title='Permanent Link: Snippet: Symfony User &#8211; Access the User Object'>Snippet: Symfony User &#8211; Access the User Object</a> <small>The following snippets provide access to the Symfony User object...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Generally, when I find something interesting I use twitter &#038; delicious to spread the word, but this morning something in my RSS Reader got me excited enough to decide to write a blog post. Thomas Rabaix has hit the nail on the head with his latest offering: <a href="http://rabaix.net/en/articles/2009/07/14/wording-is-not-a-developer-job-">Wording is not a developer job</a>. Not only with his underlying premise, but also with the solution he has developed to solve the problem of managing static content.</p>
<p>All-too-often developers are sent change requests which are nothing more than to fix a typo, update an address or fix an incorrect translation. The time taken to locate, modify, and re-deploy these changes are often disproportionate with the amount of work a client would consider was involved. What Thomas&#8217; plugin does, is add to Symfony&#8217;s I18n (Internationalisation) capabilities so that all static text, in multiple languages, can be managed via a CMS-like control panel. </p>
<p>With this plugin, the power to manage all text in a web app can be handed over to clients with the rest of the administration panel. This has the benefit of further seperating content &#038; function, and the roles of copywriter, content manager, and web developer. Now if only there was a similar tool for Wordpress, my typo-fixing days would be over!</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-what-is-it-good-for' rel='bookmark' title='Permanent Link: Symfony: What is it good for?'>Symfony: What is it good for?</a> <small>Symfony is one of my favourite bits of technology. I’ve...</small></li><li><a href='http://erisds.co.uk/symfony/snippet-symfony-user-access-the-user-object' rel='bookmark' title='Permanent Link: Snippet: Symfony User &#8211; Access the User Object'>Snippet: Symfony User &#8211; Access the User Object</a> <small>The following snippets provide access to the Symfony User object...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009 Review and Aims Part II</title>
		<link>http://erisds.co.uk/general/2009-review-and-aims-part-ii</link>
		<comments>http://erisds.co.uk/general/2009-review-and-aims-part-ii#comments</comments>
		<pubDate>Sat, 11 Jul 2009 23:57:47 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[objective j]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=509</guid>
		<description><![CDATA[On the first of June I published a summary of my aims for the rest of the year. The plan was that these were 6 month goals, but that I had a cheeky extra month to start working towards them, test them out and see how realistic they were. So now that I've had my extra month it's time to review these goals, and adjust them to make sure they are both realistic and challenging.


Related posts:<ol><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>On the first of June I published a summary of my aims for the rest of the year. The plan was that these were 6 month goals, but that I had a cheeky extra month to start working towards them, test them out and see how realistic they were. So now that I&#8217;ve had my extra month it&#8217;s time to review these goals, and adjust them to make sure they are both realistic and challenging.</p>
<ol>
<li>
<h5>Get Fit</h5>
<ul>
<li>jog steadily for 30 minutes</li>
</ul>
<p>I haven&#8217;t been for a jog in several weeks. Rugby takes up a couple of hours twice a week, and I haven&#8217;t yet found the motivation to go for a jog on top of this. I am getting fitter and healthier, I just need to go for a jog and see how I&#8217;m doing with my goal.
  </p>
</li>
<li>
<h5>Conquer Javascript</h5>
<ul>
<li>Write my own application from scratch</li>
<li>Become familiar with at least one Javascript library</li>
</ul>
<p>So far I&#8217;ve had very little free time to dedicate to this cause, however work has provided me with some opportunity to get familiar with YUI. I feel like I&#8217;ve had quite a breakthrough, and goal no. 2 is certainly going well. Therefore I&#8217;ve decided to add a third JavaScript-related goal &#8211; To learn &#038; write an application in Objective J.
  </p>
</li>
<li>
<h5>Make this blog successful</h5>
<ul>
<li>Publish at least one post per week</li>
<li>Publish a full Symfony tutorial</li>
<li>Complete at least one of my personal projects</li>
<li>Increase visitor average to 50 a day</li>
<li>Increase comment average to 10 per post</li>
</ul>
<p>My first month of attempting these goals really hasn&#8217;t gone so well, mainly because the fitness thing is taking up so much of my free time. On the other hand, I have been slowly increasing my comment and visitor averages so I think I&#8217;m all set to reach my targets. I have re-written my blog css to make it easier to write posts without having to think about styling.
  </p>
</li>
</ol>
<p>All-in-all I&#8217;m off to a slow but steady start &#8211; I&#8217;ve still got plenty of time to achieve these goals. Rebalancing my life in a more healthy fashion (read: getting off my arse and doing some sport) is going to take some getting used to, but should lead to my having more energy and motivation. I think the most important thing to work on is setting aside blog time &#038; publishing something each week because without doing that nothing else will ever get done.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li><li><a href='http://erisds.co.uk/general/a-quick-update' rel='bookmark' title='Permanent Link: A Quick Update'>A Quick Update</a> <small>This past week or so I've been a busy bee...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/general/2009-review-and-aims-part-ii/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Quick Update</title>
		<link>http://erisds.co.uk/general/a-quick-update</link>
		<comments>http://erisds.co.uk/general/a-quick-update#comments</comments>
		<pubDate>Tue, 07 Jul 2009 22:24:43 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=583</guid>
		<description><![CDATA[This past week or so I've been a busy bee re-writing the CSS for this blog. That might sound like an odd thing to do, but it had become unmanageable and was slowing me down. So this is a quick heads up, if you spot any bugs please let me know - you probably won't notice the few design tweaks I've made!


Related posts:<ol><li><a href='http://erisds.co.uk/general/a-warm-welcome' rel='bookmark' title='Permanent Link: A Warm Welcome and a Brief Introduction'>A Warm Welcome and a Brief Introduction</a> <small>Following in the tradition of new beginnings that comes with...</small></li><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This past week or so I&#8217;ve been a busy bee re-writing the CSS for this blog. That might sound like an odd thing to do, but it had become unmanageable and was slowing me down. So this is a quick heads up, if you spot any bugs please let me know &#8211; you probably won&#8217;t notice the few design tweaks I&#8217;ve made though!</p>
<h3>So why did you do it?</h3>
<p>I tend to work in lots of separate css files (reset, layout, typography, colour etc) and once the major development work is done I put it all into one file and run an <a title="Clean CSS " href="http://www.cleancss.com/" target="_blank">optimisation script</a>. This is for two reasons: the first is that <a title="Don't use @import" href="http://www.stevesouders.com/blog/2009/04/09/dont-use-import/" target="_blank">@import is bad</a> (via <a title="Design Disclosure" href="http://www.designdisclosure.com/" target="_blank">@alistairstead</a>) and the second is that I don&#8217;t want my CSS to slow this site down when there is no need. I have tried out a few different CSS optimisation scripts, but I recommend <a href="http://www.cleancss.com/">Clean CSS</a> because it has plenty of options,  can leave you with varying degrees of readability and so far it hasn&#8217;t broken a single thing.</p>
<p>Anyhow, after putting all my css together into one file and minimising it I then made a few tiny tweaks to the minimised file. Then when I wanted to do a bit of major reworking I ideally needed to work with my non-minimised file, but this was now out of sync&#8230; so I was stuck! It all comes down to poor planning of my Wordpress theme &amp; poor design of my post styles &#8211; I designed the site rather than the content because I didn&#8217;t have any, and ended up with some nasty bits.</p>
<p>So lessons are learnt. I now have a manageable system and hopefully a slightly easier to read blog. It should take me less time to crank out posts (as I won&#8217;t have to mess with styling the content) and I should be back on track shortly.</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/general/a-warm-welcome' rel='bookmark' title='Permanent Link: A Warm Welcome and a Brief Introduction'>A Warm Welcome and a Brief Introduction</a> <small>Following in the tradition of new beginnings that comes with...</small></li><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/general/2009-review-and-aims' rel='bookmark' title='Permanent Link: 2009 Review and Aims'>2009 Review and Aims</a> <small>At the beginning of 2009 I had been in my...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/general/a-quick-update/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spotlight: Wordpress Pods Plugin</title>
		<link>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin</link>
		<comments>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin#comments</comments>
		<pubDate>Sun, 28 Jun 2009 22:09:02 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[spotlight]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=507</guid>
		<description><![CDATA[<img src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="Wordpress Pods CMS Plugin" title="Wordpress Pods CMS Plugin" width="300" height="162" class="align-right size-medium" />Have you ever needed to build a website which fit into the "Posts and Page" paradigm of Wordpress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &#038; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in Wordpress as long as it remains a one-to-one relationship as it can easily be achieved with <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in Wordpress requires some more dramatic extension.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li><li><a href='http://erisds.co.uk/internet/my-web-hosting-nightmare' rel='bookmark' title='Permanent Link: My Web Hosting Nightmare&#8230;'>My Web Hosting Nightmare&#8230;</a> <small>This past week and a half I have "moved home"...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="align-right size-medium" title="Wordpress Pods CMS Plugin" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="Wordpress Pods CMS Plugin" width="300" height="162" />Have you ever needed to build a website which fit into the &#8220;Posts &amp; Page&#8221; paradigm of Wordpress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &amp; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in Wordpress as long as it remains a one-to-one relationship as it can easily be achieved with <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in Wordpress requires some more dramatic extension.</p>
<p>To my knowledge there are two plugins for doing this. <a href="http://flutter.freshout.us/">Flutter</a> and <a href="http://pods.uproot.us/">Pods</a>.</p>
<h3>Flutter</h3>
<p>I started out using Flutter as I hadn&#8217;t heard of Pods but found it to be clunky, buggy &amp; unintuitive. When editing a content type (or write panel) created by Flutter it looks as though you are in the Post or Page section depending on where you placed your new content type. This is confusing and unnecessary.</p>
<p>The data types provided with Flutter are quite extensive (it even includes a colour picker). However, Flutter&#8217;s image upload control is buggy and I have experienced Flutter jumping to the wrong page, crashing Firefox and losing data. All-in-all I found it to be hard to use, missing key features and lacking documentation which meant I needed something else.</p>
<h3>Pods</h3>
<p>In essence what Pods does is turn Wordpress into Drupal. It allows you to define your own content types with multiple fields for adding data so that you can use Wordpress&#8217; admin interface and templating system to manage whatever data you want, be it just additional testimonials, or a full-blown product database. It also allows you to define templates for displaying or listing data types &amp; to write helpers and filters to handle the entry and display of complex data.</p>
<p>Pods&#8217; integration into Wordpress is much cleaner, meaning that content editing is much more intuitive than in Flutter. The many options for configuring filters and helpers has lead to a slightly complex admin interface, but one that is still highly usable. Pods also has considerably more documentation than Flutter seems to, although it is still lacking in some areas.</p>
<p>For me, the key bit of functionality which has made me love Pods is the PICK data type. It is essentially a drop-down list control, but instead of requiring you to define the options, it allows you to choose to list out other Pods, or Wordpress objects such as Posts, Pages or Users. This means you can build relationships between your content items, and that you create blocks of content for your templates by linking pods to Posts or Pages.</p>
<p>One piece of functionality I needed but isn&#8217;t present is the ability to use a PICK to create a drop-down list of all Posts and Pages to choose one to link to. A PICK data type can currently only list out Pages OR Posts OR Users etc, but not both. It is also not possible to list out Attachments, despite them being stored in the same table as Posts and pages.</p>
<p><a href="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg"><img class="align-left" title="Pods PICK interface (modified)" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg" alt="Pods PICK interface (modified)" width="280" height="311" /></a>As I needed this functionality, I decided to implement it. I have added the ability to PICK from Attachments, Posts &amp; Pages, Posts &amp; Attachments, Pages &amp; Attachments, or Posts, Pages &amp; Attachments. Only two files were modified  (<kbd>manage_pods.php</kbd> to add options to the select, and <kbd>Pods.class.php</kbd> to extend the if/else and SQL statements to choose the right data).</p>
<p>If you would like to use my modified version of the Pods plugin, I have made it available for download. Please first download the <a href="http://wordpress.org/extend/plugins/pods/">full Pods plugin</a> and install it. Then download the <a href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">podsmodified</a> and upload them to the <kbd>wp-content/plugins/pods/core</kbd> folder. I haven&#8217;t done much testing on them but it seems to work OK for me, please let me know if you have any issues &amp; I&#8217;ll endeavour to fix them.</p>
<p>So, with my extension, I have found Pods to be extremely useful in several projects. It is a very powerful and ultimately usable CMS solution. However, there are still a few areas where I feel it could be improved:</p>
<ul>
<li>The power of the PICK data type could be improved as explained above.</li>
<li>I also feel that PICKs could be further improved by allowing users to specify a simple &#8220;enum&#8221;-like data type</li>
<li>The documentation, although at extremely useful, could greatly benefit from more detail &amp; in-depth examples</li>
<li>The clunky image upload interface needs work</li>
<li>The interface is usable, but introduces new elements not present in Wordpress (namely famfamfam icon buttons) &#8211; by bringing at least the content-editing interface into line with the rest of Wordpress I believe this plugin will really come of age</li>
<li>There is currently no way to link to a Pod from a Post or Page without configuring the relationship from the Pod itself (it would be nice to be able to setup custom fields to select from Pods but not necessary as it can be done the other way around).</li>
<li>There appears to be a bug in the PICK &gt; Categories option</li>
</ul>
<p>In summary, I believe the <a href="http://pods.uproot.us/">Pods plugin</a> to be superior to Flutter and have found it more able to suit my needs. The PICK field type, filters and helpers make for an extremely powerful and expressive CMS and Pods integrates neatly with CMS so as not to confuse editors or clients, which is a key concern. I highly recommend the <a href="http://pods.uproot.us/">Pods plugin</a> and look forward to seeing it mature as it has truly enormous potential.</p>
<p>Download <a href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">Pods Modified</a>!</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li><li><a href='http://erisds.co.uk/internet/my-web-hosting-nightmare' rel='bookmark' title='Permanent Link: My Web Hosting Nightmare&#8230;'>My Web Hosting Nightmare&#8230;</a> <small>This past week and a half I have "moved home"...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Magic Kingdom Font – Space Encounter</title>
		<link>http://erisds.co.uk/design/magic-kingdom-font-space-encounter</link>
		<comments>http://erisds.co.uk/design/magic-kingdom-font-space-encounter#comments</comments>
		<pubDate>Wed, 17 Jun 2009 12:14:44 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[holiday]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=453</guid>
		<description><![CDATA[This is a pretty silly &#038; out of the norm post for me, but what the hell! Whilst in Stitch&#8217;s Great Escape @ Disneyland last month I was enthralled by the use of a clever font so that it looked like all the signs were written in an alien language. All the characters were just [...]


Related posts:<ol><li><a href='http://erisds.co.uk/personal/disneyland-here-i-come' rel='bookmark' title='Permanent Link: Disneyland, here I come!'>Disneyland, here I come!</a> <small>Two weeks ago, my slightly better half had his 30th...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This is a pretty silly &#038; out of the norm post for me, but what the hell! Whilst in Stitch&#8217;s Great Escape @ Disneyland last month I was enthralled by the use of a clever font so that it looked like all <a href="http://travel.webshots.com/photo/1231173579027916608TSKgSw">the signs were written in an alien language</a>. All the characters were just different enough from latin letters to look unreadable on first glance, but close enough to be readable if you squint a bit &#038; stare a while!</p>
<p>I have always been fascinated by foreign characters. I once tried to learn Ancient Egyptian &#038; did a short course in Mandarin as part of my Masters in International Business. So as odd as it may seem, this kind of thing is right up my street.</p>
<p><img class="aligncenter size-full wp-image-466" title="Musings of ErisDS" src="http://erisds.co.uk/wp-content/uploads/2009/06/musingsoferisds.jpg" alt="Musings of ErisDS" width="600" height="268" /></p>
<p>I vowed I&#8217;d search for the font when I got home, and lo and behold, much to my amusement it exists as a free font on <a href="http://dafont.com">Da Font</a>. It&#8217;s called <a href="http://www.dafont.com/search.php?psize=m&#038;q=space+encounter">Space Encounter</a> and it was created by <a href="http://www.dafont.com/steve-ferrera.d1263">Steve Ferrera</a> (who also has some other nice fonts on Da Font) after visiting Disney World. Those of you who have looked at <a href="http://twitter.com/erisds">my twitter page</a> with a large resolution recently might have seen something like this before, but for everyone else enjoy my little secret message :)</p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/personal/disneyland-here-i-come' rel='bookmark' title='Permanent Link: Disneyland, here I come!'>Disneyland, here I come!</a> <small>Two weeks ago, my slightly better half had his 30th...</small></li><li><a href='http://erisds.co.uk/general/its-been-a-very-quiet-month' rel='bookmark' title='Permanent Link: It&#8217;s been a Very Quiet Month&#8230;'>It&#8217;s been a Very Quiet Month&#8230;</a> <small>It's now been over a month since my last post...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/design/magic-kingdom-font-space-encounter/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wordpress 2.8</title>
		<link>http://erisds.co.uk/wordpress/wordpress-2-8</link>
		<comments>http://erisds.co.uk/wordpress/wordpress-2-8#comments</comments>
		<pubDate>Sun, 14 Jun 2009 16:46:31 +0000</pubDate>
		<dc:creator>ErisDS</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://erisds.co.uk/?p=457</guid>
		<description><![CDATA[Over the weekend I updated my blog to <a href="http://wordpress.org/development/2009/06/wordpress-28/">Wordpress 2.8</a>. It's been a <del datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.


Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li><li><a href='http://erisds.co.uk/general/a-warm-welcome' rel='bookmark' title='Permanent Link: A Warm Welcome and a Brief Introduction'>A Warm Welcome and a Brief Introduction</a> <small>Following in the tradition of new beginnings that comes with...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I updated my blog to <a href="http://wordpress.org/development/2009/06/wordpress-28/">Wordpress 2.8</a>. It&#8217;s been a <del datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.</p>
<p>So far I haven&#8217;t taken too much time to dig around but I am definitely liking the new widgets interface. I have several different sidebars (for the homepage, footer, single page, page, etc) so not having to remember to save it and then switch sidebars to make multiple changes is much, much slicker. I&#8217;m really looking to experimenting with the <a href="http://codex.wordpress.org/WordPress_Widgets_Api">new widgets API</a> as well &#8211; I&#8217;ve got a few ideas for widgets, but if anyone reading this has ideas feel free to shoot them at me :)</p>
<p>On the other hand, I really dislike the new plugins interface. Having them all in one long list without a clear indication of which ones are active or inactive is really confusing, especially when you use a lot of plugins like me! I much preferred the old design with sections, where all active plugins were at the top.</p>
<p>Has anyone else had problems with using the widgets interface in Firefox? At first I thought it was either my connection or my hosting, but it works fine in chrome, itjust freezes in Firefox, along with gmail. It&#8217;s very frustrating as although I love chrome, I really miss my delicious, evernote, firebug, and other plugins!</p>
<p><ins datetime="2009-06-14T17:34:41+00:00">Update: Is it me or is tagging not working in Wordpress 2.8? I&#8217;m completely unable to add tags to this post!</ins><br />
<ins datetime="2009-06-14T18:50:32+00:00">Update 2: It wasn&#8217;t me, it was DB Cache. Apparently that plugin causes the tagging issue along with hyperdb another DB caching plugin. Hope it&#8217;s fixed soon, but for now I can disable whilst I edit and then re-enable &#8211; fiddly but workable!</ins></p>


<p>Related posts:<ol><li><a href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li><li><a href='http://erisds.co.uk/general/a-warm-welcome' rel='bookmark' title='Permanent Link: A Warm Welcome and a Brief Introduction'>A Warm Welcome and a Brief Introduction</a> <small>Following in the tradition of new beginnings that comes with...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erisds.co.uk/wordpress/wordpress-2-8/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
