<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web International Awards &#187; javascript</title>
	<atom:link href="http://www.webia.info/category/articles/javascript-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webia.info</link>
	<description></description>
	<lastBuildDate>Tue, 09 Aug 2011 15:42:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Enhance your clients list page with jQuery goodness</title>
		<link>http://www.webia.info/articles/code/enhance-your-clients-list-with-jquery-goodness/</link>
		<comments>http://www.webia.info/articles/code/enhance-your-clients-list-with-jquery-goodness/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 15:36:48 +0000</pubDate>
		<dc:creator>Bogdan Pop</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[client list]]></category>
		<category><![CDATA[enhance]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.webia.info/?p=881</guid>
		<description><![CDATA[
I have seen a lot of web development companies, or for that matter, companies that offer IT services having a dull client list page. They usually reside to a logo showcase or a text list divided into multiple columns. This later design is what we will try to achieve in this tutorial, but we will [...]]]></description>
			<content:encoded><![CDATA[<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/11/clients_list.jpg" title="Clients list demo preview"><img src="http://www.webia.info/wp-content/uploads/2009/11/clients_list.jpg" alt="clients list demo preview" /></a></p>
<p>I have seen a lot of web development companies, or for that matter, companies that offer IT services having a dull client list page. They usually reside to a logo showcase or a text list divided into multiple columns. This later design is what we will try to achieve in this tutorial, but we will also add a service list, and map the two lists together. Pointing to a service will reveal clients that bought that service while pointing to a client will reveal services bought by that client. We will use jQuery to map the two together.</p>
<h2>The HTML</h2>
<p>I will be using HTML 5 tags for this tutorial, which means what we are building here will only work on modern browsers. However, it's just a few tags and a doctype that need to be changed to make it work on every browser. The structure of the file will be consisted of two HTML 5 tags: <em>header</em> and <em>section</em>. Enough talk, here's the code:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;header class=&quot;top-rounded&quot;&gt;
	&lt;!-- this is the horizontal bar with the gradient--&gt;
	&lt;h1&gt;Services&lt;/h1&gt;
	&lt;h2&gt;Clients&lt;/h2&gt;
&lt;/header&gt;
&lt;section&gt;
	&lt;ul class=&quot;services btlft-rounded&quot;&gt;
		&lt;!-- this is the section that will hold the services--&gt;
		&lt;li&gt;Systems Development
			&lt;ul&gt;
				&lt;li class=&quot;ubn&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Business Needs&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;dd&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Design &amp;amp; Development&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;ti&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Test &amp;amp; Implement&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;Design &amp;amp; Branding
			&lt;ul&gt;
				&lt;li class=&quot;mr&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Market Research&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;bs&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Business Strategy&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;ci&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Corporate Identity&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;obp&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Online Brand Presence&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;ue&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;User Experience&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;ia&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Information Architecture&lt;/a&gt;&lt;/li&gt;
				&lt;li class=&quot;ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Application Development&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;ul class=&quot;clients btrght-rounded&quot;&gt;
		&lt;!-- this is the section that will hold all clients --&gt;
		&lt;li class=&quot;dd ti&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Nike&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ubn di ti&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Adidas&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;dd&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Hugo Boss&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ci ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Canal +&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;mr bs ci obp&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;TV shop plus&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;CBS&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ia&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;NBC&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;mr bs ci ue ia ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;GOL TV&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ia ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;Petrom&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ue ia ad&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;OMV&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;ci obp&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;La pizza&lt;/a&gt;&lt;/li&gt;
		&lt;li class=&quot;mr&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;&quot;&gt;The shop&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/section&gt;</pre></td></tr></table></div>



<p>As you see in the code above, each list item has a various number of classes. These classes are used to identify services and to map services to clients and viceversa. The class attribute in the anchor tags is used to emphasize which clients or services are selected. With that said it is time to move on to some basic styling.</p>
<h2>The CSS</h2>
<p>I will use some rounded corners instructions, but apart from that everything else is pretty simple. Here's the CSS code</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* reset basic styling and set rounded corners */</span>
<span style="color: #00AA00;">*</span>
<span style="color: #00AA00;">&#123;</span> <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> <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> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inherit</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inherit</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
.all-rounded<span style="color: #00AA00;">,</span>
ul<span style="color: #6666ff;">.services</span> li a<span style="color: #00AA00;">,</span>
ul<span style="color: #6666ff;">.clients</span> li a			
<span style="color: #00AA00;">&#123;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btlft-rounded</span>			
<span style="color: #00AA00;">&#123;</span> border-bottom-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -moz-border-radius-bottomleft<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -webkit-border-bottom-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.btrght-rounded</span>			
<span style="color: #00AA00;">&#123;</span> border-bottom-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -moz-border-radius-bottomright<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -webkit-border-bottom-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.top-rounded</span>			
<span style="color: #00AA00;">&#123;</span> border-top-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -moz-border-radius-topleft<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -webkit-border-top-left-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> 
border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -moz-border-radius-topright<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> -webkit-border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* styling of the general structure: size, position and alike */</span>
header
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">801px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <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> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <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;">#888</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
header h1<span style="color: #00AA00;">,</span> header h2
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <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> <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> <span style="color: #00AA00;">&#125;</span>
header h1
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span> <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> <span style="color: #00AA00;">&#125;</span>
section	
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">803px</span><span style="color: #00AA00;">;</span> <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> <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <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> <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> <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span>
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.clients</span>
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">600px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* visual styling: colors, font size etc */</span>
header
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/top.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
header h1<span style="color: #00AA00;">,</span> header h2
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F6F6F6</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <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> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span>
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span> <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;">#888</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.clients</span>
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F0F0F0</span><span style="color: #00AA00;">;</span> <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;">#888</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.services</span> a<span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.clients</span> a
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span> li a		
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F0F0F0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">23px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <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;">#999</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span> li a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>hover
</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <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;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/hover_services.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span> li ul		
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.services</span> li			
<span style="color: #00AA00;">&#123;</span> <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> <span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.clients</span> li a			
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <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> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">138px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">23px</span><span style="color: #00AA00;">;</span> <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> <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;">#F0F0F0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.clients</span> li a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>hover
</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <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;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/hover_services.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.services</span> li a.selected<span style="color: #00AA00;">,</span>
ul<span style="color: #6666ff;">.clients</span> li a<span style="color: #6666ff;">.selected</span>
<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <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;">#222222</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'../images/hover_services.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>



<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/11/clients_list_issues.jpg" title="Clients list demo, columns of unequal height"><img src="http://www.webia.info/wp-content/uploads/2009/11/clients_list_issues.jpg" alt="Clients list demo, columns of unequal height" /></a></p>
<p>And <a href="http://demos.webia.info/clients_list/demo1.html" target="_new">here is a demo</a> of how what we coded looks like. Being done with HTML and CSS, we move forward to jQuery coding to map services and clients together.</p>
<h2>The jQuery</h2>
<p>As you've seen in the demo the two columns do not share the same height. If you have many services and few clients, or few services and lots of clients, it is very likely that the two columns will not be of equal height. We can easily fix that with the following jQuery code:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// resize column for same height</span>
<span style="color: #003366; font-weight: bold;">var</span> servicesHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.services'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// get height of services ul</span>
<span style="color: #003366; font-weight: bold;">var</span> clientsHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.clients'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// get height of clients ul</span>
<span style="color: #006600; font-style: italic;">// check who's bigger and set height accordingly</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>servicesHeight<span style="color: #339933;">&gt;</span>clientsHeight<span style="color: #009900;">&#41;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.clients'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>servicesHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
   <span style="color: #000066; font-weight: bold;">else</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.services'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>clientsHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>



<p>You can <a href="http://demos.webia.info/clients_list/demo2.html" target="_new">view a demo</a> with the equal height columns problem solved. Next piece of code is the one creating the behavior necessary when clicking on services.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// if services on the left are clicked</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.services a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// a service is clicked, make any, if selected, as not selected</span>
   <span style="color: #006600; font-style: italic;">// when we click one service we need to emphasize that it is selected</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set current link as selected	</span>
&nbsp;
   <span style="color: #006600; font-style: italic;">// get the services classes</span>
   <span style="color: #003366; font-weight: bold;">var</span> classesString  <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> classes <span style="color: #339933;">=</span> classesString.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// now classes contains all class attributes of the service clicked</span>
   <span style="color: #006600; font-style: italic;">// loop through all classes</span>
   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</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> classes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #006600; font-style: italic;">// set selected to all clients that have such a service</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.clients li.'</span><span style="color: #339933;">+</span>classes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">' a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>



<p>When clicking a client, same thing happens but exactly the other way. We first get the class attribute of the client to check out the services bought and then loop through those services and set them as selected. Pretty neat! Here's the code:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// if clients on the right are clicked</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.clients li a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// a client is clicked, make any, if selected, as not selected</span>
   <span style="color: #006600; font-style: italic;">// when we click one client we need to emphasize that it is selected</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set current link as selected	</span>
&nbsp;
   <span style="color: #006600; font-style: italic;">// get the client's classes</span>
   <span style="color: #003366; font-weight: bold;">var</span> classesString  <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> classes <span style="color: #339933;">=</span> classesString.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// now classes contains all class attributes of the client clicked</span>
   <span style="color: #006600; font-style: italic;">// loop through all classes</span>
   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</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> classes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #006600; font-style: italic;">// set selected to all services that were bought by the client</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.services li.'</span><span style="color: #339933;">+</span>classes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">' a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>



<p>And we're done. You can check out the <a href="http://demos.webia.info/clients_list/final.html" target="_new">final demo over here</a> and download the <a href="http://demos.webia.info/clients_list/clients_list.zip">source codes over here</a>. If you enjoyed this article you can stay updated to new content via our <a href="http://feeds2.feedburner.com/WebInternationalAwards" target="_new">RSS feed</a> or by <a href="http://feedburner.google.com/fb/a/mailverify?uri=WebInternationalAwards&#038;loc=en_US" target="_new">email</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.webia.info/articles/code/enhance-your-clients-list-with-jquery-goodness/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Javascript DOs and DONTs. Complete with 17 examples from real web</title>
		<link>http://www.webia.info/articles/javascript-articles/javascript-dos-and-donts-complete-with-17-examples-from-real-web/</link>
		<comments>http://www.webia.info/articles/javascript-articles/javascript-dos-and-donts-complete-with-17-examples-from-real-web/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:17:34 +0000</pubDate>
		<dc:creator>Bogdan Pop</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[showcase]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[degradation]]></category>
		<category><![CDATA[do]]></category>
		<category><![CDATA[don't]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[progressive enhancement]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[worst practices]]></category>

		<guid isPermaLink="false">http://www.webia.info/?p=598</guid>
		<description><![CDATA[I've talked about accessibility a couple of times, especially when the main technology used to build a site was flash. You can check the first and the second flash degradation articles before reading this one. In this article I will cover some DOs and DONTs with regard to javascript enhanced websites.
There's only around 5% of [...]]]></description>
			<content:encoded><![CDATA[<p>I've talked about accessibility a couple of times, especially when the main technology used to build a site was flash. You can check the <a href="http://www.webia.info/articles/usability/graceful-flash-degradation/">first</a> and the <a href="http://www.webia.info/articles/graceful-flash-degradation-reloaded/">second</a> flash degradation articles before reading this one. In this article I will cover some DOs and DONTs with regard to javascript enhanced websites.</p>
<p>There's only around 5% of internet users which do not have javascript turned on, but that doesn't mean you should disregard them and create a beautifully working site with javascript which fails completely if javascript is not available.</p>
<p>In order to fully understand what I am talking about, you should visit the sites showcased in this article, view them with javascript on, then turn off javascript and refresh to see the difference. Some sites, as you'll see, do a better job then others when it comes to working properly without javascript. All these sites are impressive if javascript is on, but may be completely useless if javascript is off.</p>
<h2>Really good examples of javascript enhanced sites</h2>

<h2><a href="http://www.loewy.com/" target="_new">Helloewy</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_helloewy.jpg" title="loewy.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_helloewy.jpg" alt="loewy.com screenshot" /></a></p>
<p>Helloewy is the blog of Loewy, a NY web development company. They created an accordion for the entire posts structure of the blog which works quite well. I've seen many accordions across the web, but this one's the first one that also automatically scrolls your page and adjusts its position accordingly to the tab you just clicked. The best thing is that with javascript off, there's no accordion, but all the content is there in the exact layout. It's just that it is all expanded, which doesn't bother me - the what is javascript user? - at all.</p>

<h2><a href="http://www.youlove.us/one" target="_new">Youlove</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_youlove.jpg" title="youlove.us/one screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_youlove.jpg" alt="youlove.us/one screenshot" /></a></p>
<p>Youlove's older version of the site was bundled with awesome transparencies, animations, sliders and scrollers which resulted in a visual aesthetic that took your breath away. The new version is similar, but for me, its not that bright as the previous one. With javascript off, that first version gave nothing up in terms of usability and available content. It just got rid of animations, sliders and scrollers. Transparency was preserved as it was built using CSS not javascript. Awesome website!</p>

<h2><a href="http://www.alexcohaniuc.com/" target="_new">Alexandru Cohaniuc</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_alex_cohaniuc.jpg" title="alexcohaniuc.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_alex_cohaniuc.jpg" alt="alexcohaniuc.com screenshot" /></a></p>
<p>Alex's website is similar to the first one presented just before. It also uses an accordion to group his portfolio on categories, all tabs beeing expanded if javascript is off. It is a one page website, and the little javascript tricks add some spices to its design and make it beautiful.</p>

<h2><a href="www.tedxbucharest.com" target="_new">TEDx Bucharest</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_tedx.jpg" title="tedxbucharest.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_tedx.jpg" alt="tedxbucharest.com screenshot" /></a></p>
<p>TEDx Bucharest has and interesting and original concept in terms of layout, structure and navigation. Funny thing is it uses javascript for a small amount of the website, which is flying in a few thumbnails on the homepage / guests page, and to create some sort of a tooltip while hovering those thumbnails. Besides the flying in effect, the strange tooltip could have been easily created with some tricky css. The important point here is that with javascript off all functionalities are preserved. Nothing too extraordinary, but the concept and progressive enhancement cannot be disregarded.</p>

<p>The full article will contain more example of website that do a bad job when using javascript, and some who are right on the edge of falling in the same category, but are not quite there yet.</p>
<span id="more-598"></span>

<h2>Really bad examples of javascript enhanced sites</h2>
<h2><a href="http://unowhy.com/" target="_new">U No Why</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_unowhy.jpg" title="unowhy.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_unowhy.jpg" alt="unowhy.com screenshot" /></a></p>
<p>U No Why is simply Amazing! It has a totally original navigation concept. It moves so smoothly and responds fast to user's mouse, is bundled with lots of visual effects and subtle transparencies but unfortunately turns into a screenshot if javascript is off. In fact, if javascript is off, you can either look at one photo, click the logo or close the browser. Which one would you choose?</p>

<h2><a href="http://www.engageinteractive.co.uk/" target="_new">Engage Interactive</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_engage_interactive.jpg" title="engageinteractice.co.uk screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_engage_interactive.jpg" alt="engageinteractice.co.uk screenshot" /></a></p>
<p>Engage interactive is entirely constructed on sliding doors, panels and slideshows. All are powered by jQuery. There's quite some JS work behind this site. Very well thought off, javascript tags are located at the end of the source files. On the other hand with javascript off parts of their site are inaccessible the menu being nowhere to be found. You could still check out a part of their portfolio though, if that's any good because they fail the ultimate goal, which is allowing visitors to contact them. Twitter link doesn't count here!</p>

<h2><a href="http://www.inaldjafar.com/" target="_new">Djafar Inal</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_djafar_inal.jpg" title="inaldjafar.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_djafar_inal.jpg" alt="inaldjafar.com screenshot" /></a></p>
<p>I gave two examples of websites that successfully use accordions to enhance user experience. Here's one that fails almost completely. Inal's website fails because if javascript is off, there's only one tab of the accordion fully expanded. This may be due to the fact that Inal's website uses a horizontal accordion as opposed to Alex's and Helloewy's websites above which have vertical accordions. However, a few css tricks and if javascript were off, those tabs on Inal's website could have all been expanded and placed vertically.</p>

<h2><a href="http://madebyelephant.com/" target="_new">Made by Elephant</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_made_by_elephant.jpg" title="madebyelephant.com screenshot. Looking a bit messed up with javascript off"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_made_by_elephant.jpg" alt="madebyelephant.com screenshot" /></a></p>
<p>Another website that uses jQuery a lot. Sliding doors, tabs, forms. It looks and feels great if you have javascript available. The moment it's gone, the whole site gets scrambled. No thank you!</p>

<h2><a href="http://www.sourcebits.com/nerve/" target="_new">Nerve Music Store</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_nerve.jpg" title="Nerve Music Store screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_nerve.jpg" alt="Nerve Music Store screenshot" /></a></p>
<p>Nerve is a music store that has its entire UI developed using javascript. That's great because the interactivity provided is awesome and could rival easily with Beatport. Just turn your javascript off and then you get a spinning gear that spins and spins and spins...Forever.</p>

<h2><a href="http://eyedraw.eu/" target="_new">Eyedraw</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_eyedraw.jpg" title="eyedraw.eu screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_eyedraw.jpg" alt="eyedraw.eu screenshot" /></a></p>
<p>Eyedraw is yet another site that uses plenty of sliders and sliding doors. These features make it look chic. Unfortunately, with javascript off you're left to viewing a few thumbnails and no ability to contact the designer. Auch!</p>

<h2><a href="http://www.webalon.com/" target="_new">Webalon</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_webalon.jpg" title="webalon.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_webalon.jpg" alt="webalon.com screenshot" /></a></p>
<p>Webalon uses javascript to create a huge dynamic slider on their homepage and some nifty fading effects. Apart from that, it appears that they should have some sort of lightbox in their portfolio section, which unfortunately doesn't work even with javascript available. Needless to say, with javascript unavailable there's no fading and the content slider completely vanishes into a dark mist.</p>

<h2><a href="http://www.bonadiesarchitect.com/" target="_new">Bonadies Architect</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_bonadies.jpg" title="bonadiesarchitect.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_bonadies.jpg" alt="bonadiesarchitect.com screenshot" /></a></p>
<p>What was the first thing that crossed your mind when you saw the above screenshot? Hmm, let me check this minimal website? Well, please do check it with javascript off, because there's nothing more to see than what you just saw in the screenshot. Useless website if you do not have a decent modern browser with javascript on. I must say that it is really interesting if you are lucky enough to use a modern browser. Transitions, animations, elements moving around.</p>

<h2><a href="www.bestbefore.ro" target="_new">Best Before</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_bestbefore.jpg" title="bestbefore.ro screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_bestbefore.jpg" alt="bestbefore.ro screenshot" /></a></p>
<p>Best Before has a really, really interesting website. Smooth animations, fading elements, movement of elements around the page make sliders look dull. Too bad the site turns into a blank page if javascript's off.</p>

<h2>Those who remained neutral: neither good, nor bad</h2>
<h2><a href="http://www.jaboh.it" target="_new">Jaboh</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_jaboh.jpg" title="jaboh.it screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_jaboh.jpg" alt="jaboh.it screenshot" /></a></p>
<p>It was a little bit hard to put this site into a category. I was going first for failure to use progressive enhancements, but then I said. Ok, it does have progressive enhancement in certain areas. Now, it depends if the homepage is considered a vital part or not. So is it? I am asking because this minimal site that "abuses" of sliders, slideUps and slideDowns throughout its content areas and navigation has one major problem when javascript is off. The content on the homepage suddenly disappears. Call for Sherlock Holmes guys!</p>

<h2><a href="http://www.loewydesign.com/" target="_new">Loewy design</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_loewy.jpg" title="loewydesign.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_loewy.jpg" alt="loewydesign.com screenshot" /></a></p>
<p>Does Loewy sound familiar? yes it does. And it does because they did a great job with their blog, which is showcased up in this article. Anyhow, the agency seems to lack consistency as their main website has some issues. While javascript is on the site is bundled with smooth animations, a nice navigation and sorting menu in their portfolio section and more. If javascript's not available some features like the aforementioned sorting menu stop working. The most important fact here is that the site remains accessible. One can navigate wherever would like, use the contact form, but those little details that made the site interesting are gone.</p>

<h2><a href="http://www.adamrix.com/" target="_new">Adam Rix</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_adamrix.jpg" title="adamrix.com screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_adamrix.jpg" alt="adamrix.com screenshot" /></a></p>
<p>Adamrix is a full page slideshow that showcases the portfolio of a talented designer from Manchester. The site lacks navigation and means for making contact if javascript is off.</p>

<h2><a href="http://www.position-relative.net" target="_new">Position Relative</a></h2>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/10/js_positionrelative.jpg" title="position-relative.net screenshot"><img src="http://www.webia.info/wp-content/uploads/2009/10/js_positionrelative.jpg" alt="position-relative.net screenshot" /></a></p>
<p>Position Relative uses javascript to animate navigation - it is a one page website - and to create a nice lightbox, which I think is custom made. With javascript off, there's no animations and the lightbox turns into links to new pages. The navigation also meets some issues because without javascript, jumping to the exact location of the correct section is not pixel perfect. Scrolling with the mouse fixes this issue.</p>

<p>Similar posts will follow. I could use a helping hand in finding really unique and original pieces of material so please let me know about any websites you may have similar to these ones. If you liked this article you can subscribe to our <a href="http://feeds2.feedburner.com/WebInternationalAwards" target="_new">RSS feed</a> and stay updated as new articles get published.</p>]]></content:encoded>
			<wfw:commentRss>http://www.webia.info/articles/javascript-articles/javascript-dos-and-donts-complete-with-17-examples-from-real-web/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Multi column layout, equal height</title>
		<link>http://www.webia.info/articles/design/multi-column-layout-equal-height/</link>
		<comments>http://www.webia.info/articles/design/multi-column-layout-equal-height/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 09:52:52 +0000</pubDate>
		<dc:creator>Bogdan Pop</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[equal height]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://www.webia.info/?p=142</guid>
		<description><![CDATA[This post was inspired by the actual development of this design. The process would have been easy but, as I wanted to add the post info (date, comments) as an ear, floating on the left of the content box, things got a little more complicated. One solution was using some technique based on faux columns, [...]]]></description>
			<content:encoded><![CDATA[<p>This post was inspired by the actual development of this design. The process would have been easy but, as I wanted to add the post info (date, comments) as an ear, floating on the left of the content box, things got a little more complicated. One solution was using some technique based on faux columns, having a content wrapper and a sidewrapper. The content wrapper would float to the left. The post info box would float relative to its parent to the left, but only that would have kept the box inside the content wrapper, not right just next to it.
</p>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights1_big.jpg" class="showsketchfloating" target="_self" title="Floating post info box inside the content box"><img src="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights1.jpg" alt="Floating post info box inside the content box" /></a></p>
<span id="more-142"></span>
<h2>The temporary solution</h2>
<p>This issue has a relatively fast solution. You just put a negative left margin to the post info box, and it should go right out of there. This works relatively ok. The problems is that only really new browsers had no issues with this. I tested on IE 6, Firefox 1.06 and the post info box with negative margins disappeared from the view. That was due to the fact that the negative margin moved the box outside the content wrapper.
</p>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights2.jpg" class="showsketchfloating" target="_self" title="Floating post info box with negative margins, outside of the content wrapper"><img src="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights2.jpg" alt="Floating post info box with negative margins, outside of the content wrapper" /></a></p>
<p>That could have been easily fixed by expanding the content wrapper with the post info box width, and floating the content to the right. Basically, this would have been a faux column layout inside another faux column layout. It works great, but when you hit the next problem, there are no apparent solutions at the horizon.
</p>
<h2>What if you want rounded corners? CSS 3 rounded corners!</h2>
<p>The problem with rounded corners is that you cannot expand the content wrapper, as the corners would go away from the content, rendering the layout useless. (check out the below image). The solution I found was to add a new wrapper, which would wrap the post info box, the content boxes (multiple posts have multiple boxes), and the side wrapper.
</p>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights3.jpg" class="showsketchfloating" target="_self" title="Rounded corners on expanded box vs new overall wrapper"><img src="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights3.jpg" alt="Rounded corners on expanded box vs new overall wrapper" /></a></p>
<p>That new wrapper looks great. All you need to do is to add left rounded corners to the content boxes, and right rounded corners to the side wrapper. WRONG! That would work in most cases, but if you have a really long side wrapper, chances are you will have pages with content that do not have the same height! And that's when the cookie crumbles. Check out how you could end up with your background.
</p>
<p class="imgpreview"><a href="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights4.jpg" class="showsketchfloating" target="_self" title="Rounded corners with new wrapper installed. Content height lower than side wrapper"><img src="http://www.webia.info/wp-content/uploads/2009/03/column_equal_heights4.jpg" alt="Rounded corners with new wrapper installed. Content height lower than side wrapper" /></a></p>
<p>We put all that thinking into it and it looks like it doesn't work. Ok then, Browsers 1 - Developers 0. Some say you can fix this problem with going to css height and min-height properties. Having a body , html and wrappers with <strong>height:100%</strong>, and the last content box having <strong>min-height:100%</strong> should fix the problem. Well it doesn't. It does that if you don't have many nested wrappers. If you have many wrappers, it works only if the content area's height is lower than that of the side wrapper. If it is higher, you get the original problem (just the one you see in the screen above), but transferred to the side wrapper. Browsers 1 - Developers 1 because the problem is partially solved.</p>
<h2>The ultimate solution</h2>
<p>After struggling for around 2 and a half hours with height, min-height and wrapper variations, after not reaching any solution, I fixed this in 10 minutes with jQuery. Who would have though that the solution is that simple? So what was the jQuery code to handle this issue.</p>
<p>Remember we had a content wrapper, containing content boxes, one for each post? We also have the side wrapper. The solution is to get the height of the side wrapper, the height of the content wrapper, which grows due to the content boxes, and then compare the two values. If the content wrapper's height is smaller, you should increase it to match that of the side wrapper. But how?</p>
<h2>One span and jQuery to the rescue!</h2>
<p>You simply add a span tag to the end of the last content box, not the content wrapper. If the height of the content wrapper is smaller than that of the side wrapper, set the span tag's height to be the difference between the mentioned 2 heights. The result, no matter which box is the highest, is the one you see on this very own site. With rounded corners. All the time. Browsers 1 - Developers 2.</p>
<h2>The jQuery code</h2>
<code><pre>
	var diff = 0;
	var sideWrapper = 0;
	var cWrapper = 0;
	sideWrapper = $('#sidewrapper').height();
	cWrapper = $('#cwrapper').height();
	if(cWrapper < sideWrapper)
		{
			diff = sideWrapper - cWrapper;
			$(".end").height(diff);
		}
</pre></code>
<p>I hope you enjoyed this article. Let me know what you think about it in the comments. If you liked this one, you can stay updated to upcoming articles via the <a href="http://feeds2.feedburner.com/WebInternationalAwards" target="_new">rss feed</a>. A demo, and full source of this layout will be soon available.</p>]]></content:encoded>
			<wfw:commentRss>http://www.webia.info/articles/design/multi-column-layout-equal-height/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

