<?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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Web Design Dorset - Scott Darby</title>
	
	<link>http://www.scottdarby.com</link>
	<description>Portfolio and web design blog</description>
	<lastBuildDate>Tue, 02 Feb 2010 11:50:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</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" type="application/rss+xml" href="http://feeds.feedburner.com/ScottDarby-WebDesigner" /><feedburner:info uri="scottdarby-webdesigner" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>New website for Jazz Musician Paul Burger</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/RzvSzT3ZwM8/</link>
		<comments>http://www.scottdarby.com/2009/12/new-website-for-jazz-musician-paul-burger/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 15:45:55 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Commercial Photography]]></category>
		<category><![CDATA[Creative Web Design]]></category>
		<category><![CDATA[Dorset Website Designs]]></category>
		<category><![CDATA[Small Business Websites]]></category>
		<category><![CDATA[Audio Player]]></category>
		<category><![CDATA[Creative]]></category>
		<category><![CDATA[Jazz]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Musician]]></category>
		<category><![CDATA[Reto Website Design]]></category>
		<category><![CDATA[Saxophonist]]></category>
		<category><![CDATA[Vintage Design]]></category>
		<category><![CDATA[Wedding Music]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=299</guid>
		<description><![CDATA[<a href="http://www.scottdarby.com/2009/12/new-website-for-jazz-musician-paul-burger/"><img align="left" hspace="5" width="150" height="150" src="http://www.scottdarby.com/wp-content/uploads/2009/12/Paul-Berger-150x150.jpg" class="alignleft wp-post-image tfe" alt="Jazz Musician" title="Jazz Musician" /></a>We have created a website for saxophonist Paul Burger, who wanted a design to match his printed brand material.  The design has a vintage look which suits his service well. We provided the photographs on the site of Paul&#8217;s Saxophone in our studio, which really adds to the site visually. Paul often plays at events [...]]]></description>
			<content:encoded><![CDATA[<p>We have created a website for saxophonist <a target="_blank" href="http://www.paulburger.co.uk/">Paul Burger</a>, who wanted a design to match his printed brand material.  The design has a vintage look which suits his service well. We provided the photographs on the site of Paul&#8217;s Saxophone in our studio, which really adds to the site visually. Paul often plays at events from weddings, cocktail parties to corporate events and wanted a simple brochure website to showcase his services.  We have created an online presence for the business, which will improve the number of enquiries the business gains as 80% of couples now search for wedding suppliers online.</p>
<div id="attachment_300" class="wp-caption aligncenter" style="width: 510px"><a targer="_blank" href="http://www.paulburger.co.uk"><img class="size-full wp-image-300" title="Jazz Musician's website" src="http://www.scottdarby.com/wp-content/uploads/2009/12/Paul-Berger.jpg" alt="Jazz Musician's website" width="500" height="374" /></a><p class="wp-caption-text">Jazz Musician&#39;s website</p></div>
<p>The site includes an audio player so potential clients can listen to samples of Paul&#8217;s music easily and get an idea of the different genres Paul offers.  Along with rolling testimonials, which can be easily updated by the client and a contact form which will provide the client with all the information they need from enquiries. The site also has a Blog, which is easily updated by the client and a great way to target search engines, driving new visitors to the site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/12/new-website-for-jazz-musician-paul-burger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/12/new-website-for-jazz-musician-paul-burger/</feedburner:origLink></item>
		<item>
		<title>Retro Website Design for Dorset Country Inn, web gallery feature.</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/3GdSK89EWo0/</link>
		<comments>http://www.scottdarby.com/2009/12/retro-website-design-for-dorset-country-inn-web-gallery-feature/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 18:18:14 +0000</pubDate>
		<dc:creator>lisa</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Creative Web Design]]></category>
		<category><![CDATA[Dorset Website Designs]]></category>
		<category><![CDATA[Small Business Websites]]></category>
		<category><![CDATA[Blandford Forum]]></category>
		<category><![CDATA[Creative]]></category>
		<category><![CDATA[Dorset Web Design]]></category>
		<category><![CDATA[Restuarant]]></category>
		<category><![CDATA[Retro]]></category>
		<category><![CDATA[Retro Web Design]]></category>
		<category><![CDATA[Vintage]]></category>
		<category><![CDATA[Wedding Venue]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=288</guid>
		<description><![CDATA[<a href="http://www.scottdarby.com/2009/12/retro-website-design-for-dorset-country-inn-web-gallery-feature/"><img align="left" hspace="5" width="150" height="150" src="http://www.scottdarby.com/wp-content/uploads/2009/11/design-fridge1-150x150.jpg" class="alignleft wp-post-image tfe" alt="Retro Web Design" title="Retro Web Design" /></a>
Dorset Country Inn, The Langton Arms has been featured on creative Web Design Gallery Designfridge along with other stunning Retro inspired designs.  The Langton Arms site was designed to get across the welcoming and relaxed atmosphere at the Inn in Blandford Forum.  With its textured dark background in contrast with bright photography which we also [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div id="attachment_292" class="wp-caption aligncenter" style="width: 447px"><a href="http://www.designfridge.co.uk/gallery/web-design-trends/retro"><img class="size-full wp-image-292   " title="Retro Web Design" src="http://www.scottdarby.com/wp-content/uploads/2009/11/design-fridge1.jpg" alt="Retro Web Design" width="437" height="299" /></a><p class="wp-caption-text">Retro Web Design</p></div>
<p>Dorset Country Inn, <a href="http://www.thelangtonarms.co.uk/">The Langton Arms</a> has been featured on creative Web Design Gallery <a href="http://www.designfridge.co.uk/gallery/web-design-trends/retro">Designfridge</a> along with other stunning Retro inspired designs.  The Langton Arms site was designed to get across the welcoming and relaxed atmosphere at the Inn in Blandford Forum.  With its textured dark background in contrast with bright <a href="http://www.scottdarby.com/prices/#photography">photography</a> which we also provided, the site evokes a sense of English Tradition.</p>
<p>If you are looking for a creative website and want to find out what we can offer then do <a href="http://www.scottdarby.com/contact/"><strong>Get In Touch!</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/12/retro-website-design-for-dorset-country-inn-web-gallery-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/12/retro-website-design-for-dorset-country-inn-web-gallery-feature/</feedburner:origLink></item>
		<item>
		<title>Web Design Dorset – New Website design for The Langton Arms, Dorset Country Inn &amp; Wedding Venue</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/U5OBvlnD7I4/</link>
		<comments>http://www.scottdarby.com/2009/10/web-design-dorset-new-website-design-for-the-langton-arms-dorset-country-inn-wedding-venue/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 15:37:50 +0000</pubDate>
		<dc:creator>lisa</dc:creator>
				<category><![CDATA[Commercial Photography]]></category>
		<category><![CDATA[Dorset Website Designs]]></category>
		<category><![CDATA[Small Business Websites]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Creative Web Design]]></category>
		<category><![CDATA[Dorset Web Designer]]></category>
		<category><![CDATA[Food Photography]]></category>
		<category><![CDATA[Small Business Website]]></category>
		<category><![CDATA[The Langton Arms]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=269</guid>
		<description><![CDATA[<a href="http://www.scottdarby.com/2009/10/web-design-dorset-new-website-design-for-the-langton-arms-dorset-country-inn-wedding-venue/"><img align="left" hspace="5" width="150" height="150" src="http://www.scottdarby.com/wp-content/uploads/2009/10/The-Langton-Arms-Homepage-150x150.jpg" class="alignleft wp-post-image tfe" alt="The Langton Arms Homepage" title="The-Langton-Arms-Homepage" /></a>We are so excited to have completed the new website for The Langton Arms, Country Inn, Tarrant Monkton.  We worked closely with the team at The Langton Arms to create a brand new design and branding for the site.
We love working with businesses which allow us to be creative and the Langton Arms certainly did.  [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_270" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.thelangtonarms.co.uk"><img class="size-full wp-image-270" title="The-Langton-Arms-Homepage" src="http://www.scottdarby.com/wp-content/uploads/2009/10/The-Langton-Arms-Homepage.jpg" alt="The Langton Arms Homepage" width="600" height="429" /></a><p class="wp-caption-text">The Langton Arms Homepage</p></div>
<p>We are so excited to have completed the new website for <a href="http://www.thelangtonarms.co.uk">The Langton Arms</a>, Country Inn, Tarrant Monkton.  We worked closely with the team at The Langton Arms to create a brand new design and branding for the site.</p>
<p>We love working with businesses which allow us to be creative and the Langton Arms certainly did.  We met with owner Barbara Cossins to discuss what she was looking for and to find out what was important about The Langton Arms.  Barbara told us that they believe in good quality local produce and source their food locally, where possible.  Their <a href="http://www.thelangtonarms.co.uk/restaurant/">A La Carte menu</a> is equally important to them as <a href="http://www.thelangtonarms.co.uk/bar/">The Traditional Fayre</a>.  They are a very proud to be a country pub and to support local suppliers.</p>
<p>The bar and beer garden is also a key part of any public house, with fine ales from award winning breweries this was also something Barbara and the team were keen to promote.</p>
<p>As a popular <a href="http://www.thelangtonarms.co.uk/weddings/">Wedding Venue</a>, particularly for those looking for something a little different The Langton Arms is the perfect country wedding venue and my partner Lisa (<a href="http://www.lisadawn.co.uk">Lisa Dawn Photography</a>) has been privileged to shoot a number of weddings there so you will see our photography throughout the site.</p>
<p>So we came up with a site to promote all that is important to The Langton Arms.  Their <a href="http://www.thelangtonarms.co.uk/blog">Blog</a> is now a place where you can find out a little more behind the scenes and the events and news going on at The Langton Arms.</p>
<p>Barbara&#8217;s other request was for the site to be very visual, as we specialise in Photography we were more than happy to help!  The Chef Sion set up some beautiful dishes for us to photograph which really shows the quality of the food which is served.</p>
<div id="attachment_272" class="wp-caption aligncenter" style="width: 627px"><a href="http://www.thelangtonarms.co.uk"><img class="size-full wp-image-272" title="A La Carte Food" src="http://www.scottdarby.com/wp-content/uploads/2009/10/restaurant_031.jpg" alt="A La Carte Food" width="617" height="368" /></a><p class="wp-caption-text">A La Carte Food</p></div>
<div id="attachment_274" class="wp-caption aligncenter" style="width: 627px"><a href="http://www.thelangtonarms.co.uk"><img class="size-full wp-image-274" title="Traditional Fayre, dessert" src="http://www.scottdarby.com/wp-content/uploads/2009/10/restaurant3.jpg" alt="Traditional Fayre, dessert" width="617" height="368" /></a><p class="wp-caption-text">Traditional Fayre, desert</p></div>
<div id="attachment_273" class="wp-caption aligncenter" style="width: 627px"><a href="http://www.thelangtonarms.co.uk"><img class="size-full wp-image-273" title="Pink Mullet, The Langton Arms" src="http://www.scottdarby.com/wp-content/uploads/2009/10/restaurant2.jpg" alt="Pink Mullet, The Langton Arms" width="617" height="368" /></a><p class="wp-caption-text">Pink Mullet, The Langton Arms</p></div>
<p>Take a look and see what you think&#8230; <a href="http://www.thelangtonarms.co.uk"><strong>The Langton Arms Website</strong></a></p>
<p>If you are a business and are looking for a fresh look and want your site to perform well in Google do <a href="http://www.scottdarby.com/contact/"><strong>Get In Touch!</strong></a> Prices start from as little as <strong>£399</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/10/web-design-dorset-new-website-design-for-the-langton-arms-dorset-country-inn-wedding-venue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/10/web-design-dorset-new-website-design-for-the-langton-arms-dorset-country-inn-wedding-venue/</feedburner:origLink></item>
		<item>
		<title>How to build persistent expandable/collapsible navigation with jQuery and the jQuery Cookie plugin</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/vJi-OxhFdps/</link>
		<comments>http://www.scottdarby.com/2009/06/how-to-build-persistent-expandable-collapsible-navigation-jquery-cookie-plugin/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 14:46:16 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=196</guid>
		<description><![CDATA[If you have any experience with jQuery, one of the first things you probably learnt to do was show and hide content. jQuery makes this very simple with it&#8217;s built in show() and hide() methods, but sometimes it can be useful for the show/hide state of your items to persist from page to page. This [...]]]></description>
			<content:encoded><![CDATA[<p>If you have any experience with jQuery, one of the first things you probably learnt to do was show and hide content. jQuery makes this very simple with it&#8217;s built in <span class="codeEl">show()</span> and <span class="codeEl">hide()</span> methods, but sometimes it can be useful for the show/hide state of your items to persist from page to page. This allows the user to have a more personal experience of your site or web application by refining the information they are presented with to what is important to them.</p>
<p>In this tutorial I will build a jQuery plugin which remembers the closed/open state a side navigation menu, which conveniently follows the structure of the sidebar navigation in Wordpress.</p>
<p><a href="http://www.scottdarby.com/tutorials/collapsibleNavigation/" rel="blank" title="This link opens in a new window">View finished example</a>.</p>
<p>The finished plugin will work with any list that follows this structure, begin by creating a new HTML page with the following markup in it:</p>
<pre class="brush: html">
<ul id="aside">
<li id="archives">

<!--element to click on to hide content-->
<h2>Archives</h2>

  <!-- start content to show/hide-->
<ul>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
</ul>

  <!-- end content to show/hide-->
</li>
<li id="categories">

<!--element to click on to hide content-->
<h2>Categories</h2>

  <!-- start content to show/hide-->
<ul>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
<li>Nav item</li>
</ul>

  <!-- end content to show/hide-->
</li>
</ul>
</pre>
<p>This plugin requires the <a href="http://code.google.com/p/jqueryjs/source/browse/trunk/plugins/cookie/jquery.cookie.js?spec=svn6125&#038;r=6125" rel="blank" title="This page opens in a new window">jQuery cookie plugin</a>, download it and save it as in your root folder.</p>
<p>Create a new file called collapsibleNav.js and inlcude the following files in the document <span class="codeEl">&lt;head&gt;</span> tag:</p>
<pre class="brush: html">
	<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="jquery.cookie.js"></script>
	<script type="text/javascript" src="collapsibleNav.js"></script>
</pre>
<p>Open up your new collapsibleNav.js file, start the plugin and give it some default variables:</p>
<pre class="brush: javascript">
jQuery.fn.collapsibleNav = function(options) {

	var defaults = {
		hideByDefault: 'categories,archives', //ids of elements you want hidden by default
		clickController: 'h2', //your heading elements
		slideSpeed: 150 //speed of animation
	};

	//initial variables
	var opts = jQuery.extend(defaults, options),
		$list = jQuery(this), //reference list passed to plugin
		$heading = $list.find(opts.clickController), //cache heading element
		$listItems = $list.children(), //get each top level list item
		closedItems; //define var for items to be stored in cookie
</pre>
<p>Now create the following function. This will be called each time a list heading is clicked and will add the id of the list item to the cookie, or remove it if it is already in the cookie:</p>
<pre class="brush: javascript">
	//function that is called when slidable is clicked
	function updateArray(e) {

		//get id of element clicked for adding to closed items array
		var eId = jQuery(e).attr('id');

		//look for element in cookie array
		var arrPos = jQuery.inArray(eId, closedItems);

		if (arrPos == -1) {

			//element is not in array, so add it
			closedItems.push(eId);

		} else {

			//element is in array, so remove it
			closedItems.splice(arrPos, 1);

		}

		//update cookie
		jQuery.cookie('closedItems', closedItems, { path: '/', expires: 365 });
	}
</pre>
<p>We now need to check if the jQuery Cookie plugin has been included, and if so do the following: if there is no cookie with our closed items in it: create a new cookie with the elements you want hidden by default in, if there is a cookie present: apply a &#8220;closed&#8221; class to all of the list-items with their id in the cookie, then hide the child ul element of list items with a &#8220;closed&#8221; class.</p>
<pre class="brush: javascript">
	//remember closed/open state of nav items

	//check that the cookie plugin is available
	if (jQuery.cookie) {

		/*
		  if no cookie called "closedItems" exists, then create one with
		  elements you want hidden by default.
		  '1' is given as first value to prevent cookie from being
		  deleted if it contains no ids
		*/
		if (!jQuery.cookie('closedItems')) {
			jQuery.cookie('closedItems', '1,'+opts.hideByDefault, { path: '/', expires: 365 });
		}

		//if cookie called "closedItems" exists
		if (jQuery.cookie('closedItems')) {

			//split cookie into array
			closedItems = jQuery.cookie('closedItems').split(',');

			//iterate through array and apply "closed" class to each element within it
			for (var i = 0; i < closedItems.length; ++i) {
				jQuery('#' + closedItems[i]).addClass('closed');
			}

			//hide child ul for list items that have a class of closed
			jQuery('.closed').children('ul').hide();
		}
	}
</pre>
<p>We will now add an icon to each heading to indicate that it can be clicked to show/hide content. It is important to add this with JavaScript and not write it directly into the markup, as we only want people with JavaScript enabled to know that the headings can be clicked.</p>
<pre class="brush: javascript">

	//add span to each heading
	$heading.append('<span class="toggleIcon"> </span>');
</pre>
<p>We now need to wire up each heading so that when it is clicked it hides or shows the content and sends the element clicked on to our updateArray function. We will finish by returning the jQuery object so that our list can be used again via chaining.</p>
<pre class="brush: javascript">
	$heading.click(function(){

		var $target = jQuery(this),
			$parent = $target.parent();

		//toggle closed class
		$parent.toggleClass('closed');

		//show/hide content
		$target.next().slideToggle(opts.slideSpeed);

		//update cookie with current list-item
		updateArray($parent);

		return false;

	});

	return this;

};
</pre>
<p>Finally we need to trigger the plugin on our list, add the following javascript between <span class="codeEl">script</span> tags in your HTML document <span class="codeEl"><head></span> after all of the other <span class="codeEl">script</span> tags:</p>
<pre class="brush: javascript">

	jQuery(function(){
		jQuery('#aside').collapsibleNav();
	});
</pre>
<p>I have added some basic css in the example, but I'm sure you can come up with something more creative!</p>
<p>Thats it!</p>
<p><a href="http://www.scottdarby.com/tutorials/collapsibleNavigation/" rel="blank" title="This link opens in a new window">View finished example</a>.</p>
<p>I hope you enjoyed this post, if you did, please share it with others!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/06/how-to-build-persistent-expandable-collapsible-navigation-jquery-cookie-plugin/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/06/how-to-build-persistent-expandable-collapsible-navigation-jquery-cookie-plugin/</feedburner:origLink></item>
		<item>
		<title>jQuery plugin: Stylish Select Box – Unobtrusive select box replacement</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/9U0Nysgmj4g/</link>
		<comments>http://www.scottdarby.com/2009/05/jquery-plugin-stylish-select-unobstrusive-select-box-replacement/#comments</comments>
		<pubDate>Thu, 28 May 2009 15:20:32 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=158</guid>
		<description><![CDATA[I have released a new jQuery plugin that allows you to style the standard &#60;select&#62; form element with CSS so that it looks the same in all major browsers.
View a working demonstration.
Checkout the latest source on GitHub
Download latest source code (version 0.4)
The plugin is available to download from the jQuery website.
Tested and works with:
Firefox 3.0, [...]]]></description>
			<content:encoded><![CDATA[<p>I have released a new jQuery plugin that allows you to style the standard <span class="codeEl">&lt;select&gt;</span> form element with CSS so that it looks the same in all major browsers.</p>
<p><a  rel="blank" href="http://www.scottdarby.com/plugins/stylish-select/0.4/">View a working demonstration</a>.</p>
<p><a href="http://github.com/sko77sun/Stylish-Select">Checkout the latest source on GitHub</a></p>
<p><a id="download" href="http://www.scottdarby.com/plugins/stylish-select/0.4/stylish-select.zip">Download latest source code (version 0.4)</a></p>
<p>The plugin is available to download from the <a rel="blank" href="http://plugins.jquery.com/project/stylish-select-box/">jQuery website</a>.</p>
<p>Tested and works with:<br />
Firefox 3.0, Firefox2.0, Chrome 3, Safari 4, IE8, IE7, IE6</p>
<h2>Why?</h2>
<p>Because sometimes the browser default form styles look ugly with the rest of your site and <span class="codeEl">&lt;select&gt;</span> elements are notoriously difficult to style with <acronym title="Cascading Style Sheets">CSS</acronym>. You can see how wildly different <span class="codeEl">&lt;select&gt;</span> elements can look in different browsers with the same <acronym title="Cascading Style Sheets">CSS</acronym> applied <a  rel="blank" href="http://www.456bereastreet.com/lab/styling-form-controls-revisited/select-single/">here</a>.</p>
<h3>The IE6 issue(s)</h3>
<p>IE6 has a nasty habit of always displaying <span class="codeEl">&lt;select&gt;</span> elements on top of any other content, regardless of any z-index. This can be very annoying when using JavaScript overlays, drop down navigation etc. The only way around this issue is to use the <a rel="blank" href="http://www.cssplay.co.uk/menus/pro_drop8.html">iframe shim technique</a> which places an iframe around the content that needs to appear above the <span class="codeEl">&lt;select&gt;</span>.</p>
<p>Then there&#8217;s that <a  rel="blank" href="http://css-tricks.com/select-cuts-off-options-in-ie-fix/"> other issue of not being able to set a width</a> on <span class="codeEl">&lt;select&gt;</span> elements without clipping off any options wider than the set width.</p>
<p>While workarounds do exist for these issues, I wanted to create a drop down menu that worked exactly the same in every browser and did away with these IE6 oddities.</p>
<h2>So how does it work?</h2>
<p>Stylish Select basically grabs all of the options from your select menu, puts them into an unordered list and hides the original <span class="codeEl">&lt;select&gt;</span>. This unordered list is then made interactive, so that it functions like a browser native <span class="codeEl">&lt;select&gt;</span>. When you click on or navigate through the list with the keyboard, it updates the <span class="codeEl">&lt;select&gt;</span> in the background, so that when you submit your form, it is just like you were using the original <span class="codeEl">&lt;select&gt;</span>.</p>
<p>This newly created <span class="codeEl">&lt;select&gt;</span> now has the flexibility to be styled in whatever way you choose.</p>
<p>Alot of work has been done to make the newly created <span class="codeEl">&lt;select&gt;</span> to function like the original browser default. The plugin offers the following features:</p>
<p>Supports keyboard navigation including alpha-numerical keys<br />
If the <span class="codeEl">&lt;select&gt;</span> is at the bottom of the screen, the drop down menu stays on the screen<br />
Support for grouped options with <span class="codeEl">&lt;optgroup&gt;</span><br />
If a value is selected, the new select menu shows this option as selected</p>
<p>You can invoke the plugin on any <span class="codeEl">&lt;optgroup&gt;</span> with the following method:</p>
<p><span class="codeEl">$(&#8216;.my-dropdown&#8217;).sSelect();</span></p>
<p><a  rel="blank" href="http://www.scottdarby.com/plugins/stylish-select/0.4/">Working demonstration</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/05/jquery-plugin-stylish-select-unobstrusive-select-box-replacement/feed/</wfw:commentRss>
		<slash:comments>111</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/05/jquery-plugin-stylish-select-unobstrusive-select-box-replacement/</feedburner:origLink></item>
		<item>
		<title>How to build an expandable sitemap with jQuery and CSS</title>
		<link>http://feedproxy.google.com/~r/ScottDarby-WebDesigner/~3/XH3wevKYSZY/</link>
		<comments>http://www.scottdarby.com/2009/05/how-to-build-an-expandable-sitemap-with-jquery-and-css/#comments</comments>
		<pubDate>Wed, 13 May 2009 12:15:04 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.scottdarby.com/?p=83</guid>
		<description><![CDATA[If you are working on a site with hundreds of pages, it&#8217;s sitemap can become huge and unmanageable, leaving you to scroll through a page of links before you find what you want (yes you could just hit ctrl+f, but that&#8217;s not the point). Computer operating systems often employ tree-view navigation to aid users in [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working on a site with hundreds of pages, it&#8217;s sitemap can become huge and unmanageable, leaving you to scroll through a page of links before you find what you want (yes you could just hit ctrl+f, but that&#8217;s not the point). Computer operating systems often employ <a href="http://en.wikipedia.org/wiki/Tree_view" target="_blank">tree-view navigation</a> to aid users in navigating hierarchical data. In this tutorial I will use the power of jQuery to transform an unordered list of hierarchically structured pages into an expandable, tree-view navigation system &#8211; the perfect way to tame those huge sitemaps produced by your CMS.</p>
<p><a href="http://www.scottdarby.com/tutorials/quickTree/0.4/index.html" target="_blank">View a working example</a></p>
<p><a href="http://www.scottdarby.com/tutorials/quickTree/0.4/jquery.quickTree.zip">Download</a></p>
<h2>Getting started</h2>
<p>We will start with a simple unordered list:</p>
<pre class="brush: html">
<ul class="sitemap">
<li>Top level page
<ul>
<li>Sub page - level one
<ul>
<li>Sub page - level two
<ul>
<li>Sub page - level three</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</pre>
<p>Nothing fancy there, hopefully your sitemap is already structured in this way.</p>
<h2>jQuery time</h2>
<p>We will now create a jQuery plugin which will do the following:</p>
<ol>
<li>Hide all lists that are not on the top level</li>
<li>Add an expand/contract button next to each list-item that contains a list</li>
<li>Add classes to the last item in the each list for presentational purposes</li>
<li>Add interactivity so that if the expand/contract button is clicked, the list will show/hide</li>
</ol>
<p>We will use jQuery&#8217;s plugin interface, so begin by starting the plugin:</p>
<pre class="brush: javascript">
jQuery.fn.quickTree = function() {
    return this.each(function(){
</pre>
<p>This adds a new function to jQuery called &#8216;quickTree&#8217;. We will pass the <span class="codeEl">&lt;ul&gt;</span> element we want to transform to this function. We then use jQuery&#8217;s built in .each() iterator method to access each of the elements passed to this function.</p>
<p>Now we need to set our variables to be used in the function, by setting them once here, we can then use them again in our plugin without having to search through the <acronym title="Document Object Model">DOM</acronym> each time, saving valuable processor cycles. N.B. I am prefixing variables that are jQuery objects with a &#36; sign to aid readability
</p>
<pre class="brush: javascript">
	//access element passed to the plugin
    var $tree = $(this);

	//get all of the list-items
    var $roots = $tree.find('li');

	//add class to last item in each list for styling
	$tree.find('li:last-child').addClass('last');
</pre>
<p>We now need to hide all lists lower than the top level which can be done simply by finding all of the <span class="codeEl">&lt;ul&gt;</span> elements inside the main list and using jQuery&#8217;s .hide() method:</p>
<pre class="brush: javascript">
        $tree.find('ul').hide();
</pre>
<p>We now need to iterate through all of the list items and if they contain any child <span class="codeEl">&lt;ul&gt;</span> elements, place a <span class="codeEl">&lt;span&gt;</span> element in front of them. This <span class="codeEl">&lt;span&gt;</span> will act as our button to expand &amp; contract the list.</p>
<pre class="brush: javascript">
		//iterate through all list items
        $roots.each(function(){

			//if list-item contains a child list
            if ($(this).children('ul').length > 0) {

				//add expand/contract control
                $(this).addClass('root').prepend('<span class="expand"></span>');

            }

        }); //end .each
</pre>
<p>We will now add interactivity to the buttons with jQuery&#8217;s .toggle() method. .toggle() acts like a switch and alternates between two functions on click. Here, the first function toggles the class of the expand button (so that it can show a contract symbol with <acronym title="Cascading Style-Sheets">css</acronym>) and uses jQuery&#8217;s .slideDown() method to reveal the next level of <span class="codeEl">&lt;ul&gt;</span> elements. The second function is essentially the first function in reverse.</p>
<pre class="brush: javascript">
        $('span.expand').toggle(
			//if it's clicked once, find all child lists and expand
            function(){
                $(this).toggleClass('contract').nextAll('ul').slideDown();
            },
			//if it's clicked again, find all child lists and contract
            function(){
                $(this).toggleClass('contract').nextAll('ul').slideUp();
            }
        );
    });
};
</pre>
<h2>Presentation</h2>
<p>Now we need to use <acronym title="Cascading Style-Sheets">CSS</acronym> to enhance the presentation of the list so that it resembles a tree-structure.</p>
<p>First of all, we will reset all the margins and padding of the elements within the list with the * selector, to level the playing field. We then add some spacing to the list-items so that each consecutive lower level is indented. We also add a tree-branch background image to each list-item. This tree-branch image is a &#8216;T&#8217; shape rotated left 90&deg; and is positioned so that it is vertically centered, but horizontally fixed. The graphic has been constructed so that it is much taller than the size of the text, so that if the text size is increased, the connecting lines do not have a gap.</p>
<p>We also give the list-items that are the last in their list an &#8220;L&#8221; shaped background image. We have to then write a new rule for any list-items that are the last item in their list, but also contain lists themselves so that the &#8220;L&#8221; shaped background image is removed.</p>
<pre class="brush: css">
.tree * {
	margin:0; padding:0;
}
.tree li {
	list-style:none;
	padding-left:21px;
}
.tree li.root {
	padding-left:0;
}
.tree li li {
	background:url(rootNode.gif) no-repeat 17px center;
	margin-left:10px;
	padding-left:31px;
}
.tree li li.root {
	padding-left:10px;
	background:url(justOne.gif) repeat-y 17px 0;
}
.tree li li.root.last {
	background:none;
}
.tree li li.last {
	background:url(lastRoot.gif) no-repeat 17px 0;
}
</pre>
<p>The last thing left to do presentation-wise is to create our expand/contract button style. I have used an image replacement technique to change the span element added with JavaScript into a button (<a href="http://css-tricks.com/nine-techniques-for-css-image-replacement/" target="_blank">read more about image replacement</a>). Rather than create two images for the expanded/contracted state, I have rolled them into one image, then all I have to do is change the background-position property to change the background image.</p>
<pre class="brush: css">
.expand {
	background:url(plusMinus.gif) no-repeat;
	width:16px;
	_width:13px;
	height:16px;
	display:block;
	float:left;
	margin-top:2px;
	padding:0 5px 0 0;
	text-indent:-9999px;
	line-height:0;
	font-size:0;}
.contract {
	background-position:0 -16px;
}
.expand:hover {
	cursor:pointer;
}
</pre>
<p>The plug-in can now be used on any unordered list element on your page with the following jQuery statement:</p>
<pre class="brush: javascript">
	$(document).ready(function(){
		$('ul.my-class').quickTree();
	});
</pre>
<p><a href="http://www.scottdarby.com/tutorials/quickTree/0.4/index.html" target="_blank">View a working example</a></p>
<p><a href="http://www.scottdarby.com/tutorials/quickTree/0.4/jquery.quickTree.zip">Download</a></p>
<p>If you liked this post, please share it with others!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottdarby.com/2009/05/how-to-build-an-expandable-sitemap-with-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://www.scottdarby.com/2009/05/how-to-build-an-expandable-sitemap-with-jquery-and-css/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
