<?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>Martini Lab Blog &#187; css</title>
	<atom:link href="http://www.martinilab.com/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.martinilab.com/blog</link>
	<description>Web design, CSS, scripting, Adobe, tips and other scraps of things that come my way</description>
	<lastBuildDate>Fri, 20 Aug 2010 20:58:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Webmail adds image spacing</title>
		<link>http://www.martinilab.com/blog/224/webmail-adds-image-spacing/</link>
		<comments>http://www.martinilab.com/blog/224/webmail-adds-image-spacing/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:27:07 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=224</guid>
		<description><![CDATA[Attention you HTML email authors. Your newsletters are jacked. Webmail apps, in an effort to prevent the automatic downloading of images in order to prevent open rates for spammers, use scripts to manipulate the loading of images. Unfortunately, this changes &#8230; <a href="http://www.martinilab.com/blog/224/webmail-adds-image-spacing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Attention you HTML email authors.  Your newsletters are jacked.  Webmail apps, in an effort to prevent the automatic downloading of images in order to prevent open rates for spammers, use scripts to manipulate the loading of images.  Unfortunately, this changes the default property for <code>display</code> for images and causes gaps or spacing to occur.</p>
<h3>For example</h3>
<p>Weak sauce!</p>
<p><a href="http://www.flickr.com/photos/amboy00/4910806646/"><img alt="Email with image gaps" src="http://farm5.static.flickr.com/4097/4910806646_6123125530.jpg" title="email broken" class="alignnone" width="500" height="442" /></a></p>
<h3>Inline fix</h3>
<p>The fix is simple, add an inline style to all of your images.</p>
<pre>&lt;img src="..." style="display: block;"... &gt;</pre>
<p>This change works on gmail, hotmail, yahoo, mobileme, etc.</p>
<p>Awesome sauce!</p>
<p><a href="http://www.flickr.com/photos/amboy00/4910204573/in/photostream/"><img alt="This email has no gaps in its images" src="http://farm5.static.flickr.com/4122/4910204573_88a4ec4f28.jpg" title="email fixed" class="alignnone" width="500" height="442" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/224/webmail-adds-image-spacing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let Them Die</title>
		<link>http://www.martinilab.com/blog/167/let-them-die/</link>
		<comments>http://www.martinilab.com/blog/167/let-them-die/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 18:19:48 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=167</guid>
		<description><![CDATA[This month’s edition of A List Apart covers how to manage multiple browser vendors and their varying support for html5 and css3 1. We’re all aware of the different uses of border-radius in both FireFox and Webkit. And being able &#8230; <a href="http://www.martinilab.com/blog/167/let-them-die/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This month’s edition of A List Apart covers how to manage multiple browser vendors and their varying support for html5 and css3 <a href="#links"><sup>1</sup></a>.  We’re all aware of the different uses of <code>border-radius</code> in both FireFox and Webkit.  And being able to not fork the code in making rounded corners by simply writing standard css3 is tempting.  In fact, it’s ideal.  Having it managed with javascript is actually very clever, and… cool!</p>
<p>But I would propose something different entirely.  Instead of using a js library to help browsers properly render a soundly constructed html5/css5 webpage, short of making sure it doesn’t look like “total ass” on IE, just let the page render as it lay.</p>
<p>By now, web designers are largely aware of the rendering quirks of various browsers.  Little things like not adding margins to floating divs for IE’s sake, or not applying –webkit gradients to divs that contain text fields, are a part of mental mine field map that goes into our work.</p>
<p>Using a javascript library to get around this isn’t the answer.  Remember that script that lets IE6 properly render PNG transparency?  It might have been relevant to a couple of years ago when there were still a vast majority of users that used IE6, but most web designers have abandoned even trying to support the browser, much less trying to make every pixel line up properly or make every image look decent.  At some point (if our bosses let us), we move on.  </p>
<p>Sadly, we moved onto other scripts that do what html5 is supposed to do already.</p>
<p>Here’s my advice.  Write your site to work just fine without any javascript (or css for that matter) needed.  If you can still use the site, you’re good to go.  Using ajax history to browse back and forth with the browser chrome?  Make sure it works without javascript and move on.  If you’ve got some killer CSS mojo for your site, just write it.  Write that widget that does that thing with the stuff, but to say that we have to cover every contingency is unreasonable.  </p>
<p>When did we go from saying “to hell with bad browsers” to using libraries to keep these browsers on “the same page?”</p>
<p>Older browsers won’t go away (I still see Netscape occasionally show up on Google Analytics), but the support we give them can.  </p>
<p>I like to look at these barbaric browsers like the Klingons in Star Trek XI.  Their survival was in jeopardy and Kirk was having none of it.  Eventually, he came around and now we’re stuck with the Klingons and their foreheads forever.</p>
<p>Don’t let this happen to bad browsers.  Let them die.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Swvf3w6hcY4&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Swvf3w6hcY4&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p><a name="links">1. Links</a></p>
<ul>
<li><a href="http://www.alistapart.com/articles/stop-forking-with-css3/">Stop Forking With CSS3</a></li>
<li><a href="http://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/">Taking Advantage of HTML5 and CSS3 with Modernizr</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/167/let-them-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing thevariants.com</title>
		<link>http://www.martinilab.com/blog/155/introducing-thevariantscom/</link>
		<comments>http://www.martinilab.com/blog/155/introducing-thevariantscom/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 22:58:17 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=155</guid>
		<description><![CDATA[The Variants is a new web series sitcom about the crew of a local comic shop. So far, four promos have been produced and released in time for SDCC 2009 and Episode one is scheduled for release. Each episode (or &#8230; <a href="http://www.martinilab.com/blog/155/introducing-thevariantscom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Variants is a new web series sitcom about the crew of a local comic shop.  So far, four promos have been produced and released in time for SDCC 2009 and Episode one is scheduled for release.  Each episode (or is it webisode) runs about ten minutes.</p>
<p>Putting this together was a lot of fun.  With internet video content rising well beyond YouTube, I had many examples of what people expect from a media web site.  Plus, I got to work in a little bit of html5 semantics.</p>
<p>Go watch <a href="http://www.thevariants.com">The Variants</a> promos and laugh, laugh and laugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/155/introducing-thevariantscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with WebKit css gradients</title>
		<link>http://www.martinilab.com/blog/104/fun-with-webkit-css-gradients/</link>
		<comments>http://www.martinilab.com/blog/104/fun-with-webkit-css-gradients/#comments</comments>
		<pubDate>Fri, 15 May 2009 21:38:52 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=104</guid>
		<description><![CDATA[As a follow up to yesterday’s woeful tale of using WebKit’s proprietary css properties, I wanted to follow up with a couple examples of how one can use these features without getting all “bevel-ly” The only benefit of text-shadow is &#8230; <a href="http://www.martinilab.com/blog/104/fun-with-webkit-css-gradients/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As a follow up to yesterday’s <a href="http://www.martinilab.com/blog/91/webkit-background-clip-problem/">woeful tale</a> of using WebKit’s proprietary css properties, I wanted to follow up with a couple examples of how one can use these features without getting all “bevel-ly”</p>
<p>The only benefit of <code>text-shadow</code> is not downloading graphics for what can be expressed in css.  The same goes for <code>-webkit-border-image</code>, <code>-webkit-gradient</code>, <code>-moz-border-radius</code>, anything that keeps a web designer from having to launch Photoshop is a boon to bandwidth.</p>
<p>Here are two examples of using some WebKit css gradients.*</p>
<p><em>Update: You must have the Chrome 2.0 or Safari 4.b for these to work.</em></p>
<p><a href='http://www.martinilab.com/blog/wp-content/uploads/2009/05/album.html'>Example 1</a>. is brought to you by “Killer Queen”</p>
<p>This similar looking display to that of the iPhone album display uses a radial gradient (opposed to a linear) as the background for the track names. The overall effect is a dim light. The odd numbered tracks also use a gradient to take advantage of <code>-webkit-gradient</code>’s support of alpha values.</p>
<p><a href='http://www.martinilab.com/blog/wp-content/uploads/2009/05/calendar.html'>Example 2</a>. is a css calendar.</p>
<p>This one combines linear gradients and javascript arrays.  Because <code>-webkit-gradient</code> can use rbga formatting in place of the usual hexadecimal value, calculating the values from color to another was much easier.</p>
<p>The drawback to these browser specific properties are, well, browser specific.  While adding a gradient value to your <code>div id=wrapper</code> might give it a groovy drop shadow effect on Safari, nothing is happening on either Firefox, and much less for IE.  </p>
<p>The workaround at this point is to browser detect.</p>
<pre lang="javascript" line="1">
if(jQuery.browser.safari) {
$('#wrapper').addClass('problem-solved');
}
else {
	$('#wrapper').addClass('wah-wah-wah');
}
</pre>
<p>Or whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/104/fun-with-webkit-css-gradients/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>–webkit-background-clip Problems</title>
		<link>http://www.martinilab.com/blog/91/webkit-background-clip-problem/</link>
		<comments>http://www.martinilab.com/blog/91/webkit-background-clip-problem/#comments</comments>
		<pubDate>Thu, 14 May 2009 18:07:23 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=91</guid>
		<description><![CDATA[Someday, all the nifty Photoshop Blending options will be available as CSS properties. Mark my words! In the mean time, we’re kind of stuck with drop shadows, and now gradients (and text strokes) for WebKit browsers. Too bad you can’t &#8230; <a href="http://www.martinilab.com/blog/91/webkit-background-clip-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Someday, all the nifty Photoshop Blending options will be available as CSS properties.  Mark my words! In the mean time, we’re kind of stuck with drop shadows, and now gradients (and <a href="http://webkit.org/blog/85/introducing-text-stroke/">text strokes</a>) for WebKit browsers. Too bad you can’t use them together.</p>
<p>In order to take advantage of the background clipping, the color needs to be transparent.  First off, that pretty much ruins any other browser from displaying text.  So this is only useful to Safari users (not even the iPhone currently supports it).  In Photoshop, you can get around having a transparent color and still having a drop shadow by setting that layers Fill Opacity to 0% while the layers opacity at 100%.</p>
<p>Also, using this technique has some odd behavior with padding. In my example, I couldn’t set padding to the parent div without the effect inheriting that padding.  Restating the padding didn’t affect it either.</p>
<p>Here is the example: <a href='http://www.martinilab.com/blog/wp-content/uploads/2009/05/webkit-background-clip.html'>webkit-background-clip.html</a></p>
<p>Now, you can add the <code>-webkit-text-stroke</code> and that will work with <code>text-shadow</code>, but only on the stroke and not the text.  I’ve yet to find an example that uses all three without looking like one of Superjail’s Doctor’s <a href=" http://superjail.wordpress.com/2008/10/13/specimen-7/">genetic experiments</a>.</p>
<p>Perhaps it is for the best, getting these to work together might have been the next <code>blink</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/91/webkit-background-clip-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A better jQuery slider</title>
		<link>http://www.martinilab.com/blog/25/a-better-jquery-slider/</link>
		<comments>http://www.martinilab.com/blog/25/a-better-jquery-slider/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 22:09:51 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=25</guid>
		<description><![CDATA[If you haven’t seen Apple’s product slider in action, you must check it out. It’s a horizontal gallery of their products with horizontal slider controlled with javascript. I believe they are using the scriptaculous motion for this, but there should &#8230; <a href="http://www.martinilab.com/blog/25/a-better-jquery-slider/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you haven’t seen Apple’s product <a href="http://www.apple.com/mac/">slider</a> in action, you must check it out. It’s a horizontal gallery of their products with horizontal slider controlled with javascript.  I believe they are using the scriptaculous motion for this, but there should be a way to build this in jQuery.</p>
<p>Truth be told, I was a die-hard fanatic for scriptaculous/prototype, but after ExpressionEngine announce their adoption of jQuery for EE 2.0, it was time to grow beyond the one framework pony.</p>
<p>Luckily, someone already set out to build the slider in jQuery. And major hat’s off to Remy Sharp for a great approach to this. If you looking for a way to build your own slider, start there first.<br />
<span id="more-25"></span></p>
<h2>The Problem</h2>
<p>Actually, there was no problem until I had a client to didn’t fit into the strict mold set out for this widget. As with most inventive solutions, they are begat from necessity.</p>
<p>The slider is built on an unordered list, but doesn’t support nested lists. For my needs, the slider had to be able to not only show multiple categories of products, but also visually differentiate.</p>
<p>Now, this can be resolved by manually setting css values. This approach would “hard code” the positions of the categories. That isn’t very code may be puled from a database.</p>
<p>Also, the slider needs to work without javascript. I know. Who doesn’t use javascript? The answer is, I don’t know, but someone always points out if something doesn’t degrade properly.</p>
<h2>The Solution</h2>
<p>I built this out backwards, but it works. So don’t question it. This demo shows the slider with wireframes to show off the block level div’s and li’s.</p>
<p>You can see by this code example that the lists are simple and even has a space for the category description if your site requires it.</p>
<h2>HTML</h2>
<p>This is a simple template shoing how to format your product groups and your categories for them.  There can be as many needed.  This example should be able to display them all successfully.</p>
<pre lang="html4strict" line="1">
&lt;div id="mlSlideWidget" class="slideWidget"&gt;
	&lt;div id="sliderWindow" class="sliderGallery"&gt;
		&lt;ul class="sliderList"&gt;
			&lt;!-- Each category --&gt;
			&lt;li class="group"&gt;
				&lt;div class="groupContent"&gt;
					&lt;!-- Description info for category --&gt;
					&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum vitae diam vitae leo hendrerit aliquet. Donec dolor. Integer placerat rhoncus metus. Proin sagittis. Nullam sed lacus accumsan orci convallis interdum. Aenean aliquet, nisi et sollicitudin posuere, orci tortor fermentum.&lt;/p&gt;
					&lt;ul class="groupButtons"&gt;
						&lt;!-- Each product for this category --&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 1&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 2&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 3&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
			&lt;/li&gt;
			&lt;li class="group"&gt;
				&lt;div class="groupContent"&gt;
					&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum vitae diam vitae leo hendrerit aliquet. Donec dolor. Integer placerat rhoncus metus. Proin sagittis. Nullam sed lacus accumsan orci convallis interdum. Aenean aliquet, nisi et sollicitudin posuere, orci tortor fermentum.&lt;/p&gt;
					&lt;ul class="groupButtons"&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 4&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 5&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 6&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
			&lt;/li&gt;
			&lt;li class="group"&gt;
				&lt;div class="groupContent"&gt;
					&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum vitae diam vitae leo hendrerit aliquet. Donec dolor. Integer placerat rhoncus metus. Proin sagittis. Nullam sed lacus accumsan orci convallis interdum. Aenean aliquet, nisi et sollicitudin posuere, orci tortor fermentum.&lt;/p&gt;
					&lt;ul class="groupButtons"&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 7&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 8&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 9&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
			&lt;/li&gt;
			&lt;li class="group"&gt;
				&lt;div class="groupContent"&gt;
					&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum vitae diam vitae leo hendrerit aliquet. Donec dolor. Integer placerat rhoncus metus. Proin sagittis. Nullam sed lacus accumsan orci convallis interdum. Aenean aliquet, nisi et sollicitudin posuere, orci tortor fermentum.&lt;/p&gt;
					&lt;ul class="groupButtons"&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 10&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 11&lt;/a&gt;&lt;/li&gt;
						&lt;li class="singleButton"&gt;&lt;a href="#"&gt;Product 12&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;

	&lt;div id="scroll" class="slider"&gt;
		&lt;!-- the handler to action the slide --&gt;
		&lt;div class="handle"&gt;&lt;/div&gt;
		&lt;!-- labels appear against the slider, as pointers to the user --&gt;
		&lt;ul&gt;
			&lt;!-- These are categories --&gt;
			&lt;li class="marker"&gt;Category 1&lt;/li&gt;
			&lt;li class="marker"&gt;Category 2&lt;/li&gt;
			&lt;li class="marker"&gt;Category 3&lt;/li&gt;
			&lt;li class="marker"&gt;Category 4&lt;/li&gt;
		&lt;/ul&gt;
		&lt;div class="fakeHandle"&gt;
			&lt;table width="100%" cellpadding="0" cellspacing="0" border="0"&gt;
				&lt;tr&gt;
					&lt;td width="15"&gt;&lt;img src="images/handle-left.png" width="15" height="115" alt="&lt;" /&gt;&lt;/td&gt;
					&lt;td background="images/handle-middle.png"&gt;&nbsp;&lt;/td&gt;
					&lt;td width="15"&gt;&lt;img src="images/handle-right.png" width="15" height="115" alt="&gt;" /&gt;&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/table&gt;
		&lt;/div&gt;
	&lt;/div&gt;

&lt;/div&gt;
</pre>
<h2>CSS</h2>
<p>I threw in a dash of <a href="http://developer.yahoo.com/yui/">YUI</a>’s css reset. Most of the id and class names are generic.  I would recommend renaming these to something more specific to avoid conflict.</p>
<pre lang="css" line="1">
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, img {border-width: 0px;margin:0;padding:0;}
#mlSlideWidget {
	font:11px arial,helvetica,clean,sans-serif;
	*font-size:small;
	*font:x-small;
	position: relative;
	height: 361px;
	width: 659px;
	background: url(images/slider-background.jpg) left top no-repeat;
}

#sliderWindow {
	margin: 1px;
	height: 365px;
	position: relative;
	width: 655px;
}

.sliderGallery {
	overflow: auto;
}

.sliderGallery ul.sliderList {
	top: 0px;
	left: 0px;
	margin-top: 135px;
	padding-bottom: 0;
	position: absolute;
	list-style: none;
	height: 210px;
	overflow: auto;
	width: 2000px;
	white-space: nowrap;
}

#mlSlideWidget .sliderGallery ul li.group {
	margin-left: 7px;
	margin-right: 7px;
	display: inline;
	float: left;
}

#mlSlideWidget .sliderGallery ul li.group .groupContent {
	margin-right: 10px;
	padding-left: 10px;
	padding-top: 10px;
	padding-bottom: 10px;
}

ul.groupButtons {
	height: 120px;
}

li.group {
	background: url(images/group-backgroundcap.png) no-repeat right top;
}

li.group .groupContent{
	background: url(images/group-background.png) no-repeat left top;
}

li.group p {
	width: 430px;
	height: 70px;
	font-size: 10px;
	line-height: 12px;
	white-space: normal;
}

li.group ul.groupButtons {
	list-style: none;
	white-space: nowrap;
}

li.group ul.groupButtons li.singleButton {
	width: 140px;
	float: left;
	height: 118px;
	text-align: center;
}
#scroll {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 100;
	width: 639px;
	margin-left: 10px;
	margin-right: 8px;
}

#scroll ul {
	height: 123px;
	list-style: none;
}

#scroll li.marker {
	margin-top: 4px;
	padding-top: 60px;
	text-align: center;
	z-index: 90;
	font-size: 10px;
	height: 30px;
	width: 55px;
	padding-left: 20px;
	padding-right: 20px;
	margin-left: 10px;
	margin-right: 10px;
	float: left;
}

.handle {
	position: absolute;
	top: 8px;
	left: 0;
	z-index: 110;
	height: 115px;
}

.fakeHandle {
	position: absolute;
	top: 8px;
	left: 0;
	z-index: 80;
	height: 115px;
}
</pre>
<p>jQuery UI will need to be built with UI Core, Draggable, Slider, Effects Core, and Slide.  Some of the values of this rules in the example are built to my specs and can be modified to whatever specs fit your site.  Note the versions of jQuery at the time of this article.</p>
<p>This example doesn’t know how many objects exist in the slider.  If you use a set amount, this example can be greatly reduced.  However, if your categories are managed via a database or cms tool, the number of objects used can change.</p>
<h2>Javascript</h2>
<p>Try not to laugh at my n00b code.  I’m sure there are much better ways to write this.</p>
<pre lang="javascript" line="1">

//basic rules for controling the divs
$(document).ready(function(){

   //fix css rules
   //above css written for pages loaded without javascript
   $('.sliderGallery').css({'overflow-x': 'hidden', 'overflow-y': 'visible'});
   $('li.marker').css({'float': 'none', 'position': 'absolute', 'top': 0, 'left': 0});

	//set up some public variables and arrays
	var scrollBar = 639;
	var sliderListOffsetLeft = $('.sliderList').offset();
	var productWidth = 0;
	var groupWidth = 0;
	var sliderWidth = new Array();
	var sliderLeft = new Array();
	var groupRangeLeft = new Array();
	var marker = new Array();

	//measure the width of all the sub-categories
	//and the sub-sub-categories while we're at it
	$('li.group').each(function (i) {
		sliderLeft[i] = productWidth;
		$('li.singleButton', this).each(function (i) {
			groupWidth = groupWidth + $(this).width()
		});
		//hard coded minimum width for groups
		if (groupWidth < 450)
			groupWidth = 450;
		else
			groupWidth += 20;
		productWidth = productWidth + groupWidth + 16;
		//set width for each sub-caterogy
		sliderWidth[i] = groupWidth + 14;
		$(this).css({width: groupWidth});
		//reset the variable
		groupWidth = 0;
		//used in another function not used in demo
		groupOffsetleft = $(this).offset();
		groupRangeLeft[i] = groupOffsetleft.left - sliderListOffsetLeft.left - ((i > 0) ? 14 : 7 );
	});

	//Fix css to fit with slider content
	$('ul.sliderList').css({width: productWidth + 14});

	//Variables to make math easier
	var handle = (scrollBar / productWidth) * scrollBar;
	var markerLeft = 0;
	var scrollBarVisible = scrollBar - handle;

	$('li.marker').each(function (i) {
		markerLeft = (sliderLeft[i] / productWidth * scrollBar);
		markerWidth = (sliderWidth[i] / productWidth * scrollBar);
		$(this).css({left: markerLeft});
		marker[i] = (markerLeft / scrollBarVisible) * 100;
	});

	$('div.handle').css({width: handle});
	$('div.fakeHandle').css({width: handle});

	if (productWidth > scrollBar)
	{
		$('div.slideWidget').each(function () {
			var ul = $('ul.sliderList', this);
			var fake = $('.fakeHandle', this);

			var slider = $('.slider', this).slider({
				handle: '.handle',
				minValue: 0,
				maxValue: productWidth,
				slide: function (ev, ui) {
					ul.css('left', '-' + Math.round(ui.value / 100 * (productWidth - 657)) + 'px');
					fake.css('left', Math.round(ui.value / 100 * (scrollBar - handle)) + 'px');
				},
				stop: function (ev, ui) {
					move = ui.value / 100 * (productWidth - 657);
					ul.animate({ 'left' : '-' + Math.round(move) + 'px' }, 500);
					fake.animate({'left' : Math.round(ui.value / 100 * (scrollBar - handle)) + 'px'}, 500);
				}
			});
		})
	}

	else {
		$('.fakeHandle').css({width: 0});
		$('.handle').css({width: 0});
		$('.fakeHandle').css('visibility', 'hidden');
		$('.handle').css('visibility', 'hidden');
	}

});
</pre>
<p>Notice the versions of jQuery and UI.  1.7.1 has issues with this solution.  As of yet, I haven’t found a fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/25/a-better-jquery-slider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Peeps on Twitter</title>
		<link>http://www.martinilab.com/blog/43/my-peeps-on-twitter/</link>
		<comments>http://www.martinilab.com/blog/43/my-peeps-on-twitter/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 18:52:31 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.martinilab.com/blog/?p=43</guid>
		<description><![CDATA[Somehow I’ve ended up following too many people on Twitter. Not that I don’t want to read each and every person’s tweet, but sometimes, I really don’t care and just want to follow a select few. LiveJournal has a filter &#8230; <a href="http://www.martinilab.com/blog/43/my-peeps-on-twitter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Somehow I’ve ended up following too many people on Twitter.  Not that I don’t want to read each and every person’s tweet, but sometimes, I really don’t care and just want to follow a select few.  LiveJournal has a filter feature for both posting and reading specific sets of your LJ buddies.  Maybe twitter will set up some kind of filter.</p>
<p>Until then, here’s some css code file you can add to your Safari preferences.</p>
<pre lang="html4strict" line="1">
/* turn off all tweets */
li.status {
	display: none;
}

/* now turn on for your peeps */
li.u-zeuscomics, li.u-kingbaz, li.u-pvponline, li.u-seanjackson, li.u-AronHead, li.u-UltraboyNYC {
	display: block;
}
</pre>
<p>NOTE: css is case-sensitive.</p>
<p>It doesn’t fix the timeline of the site, so if your “peeps” haven’t updated in a while, you’ll get a blank page.  Ah, the silence!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinilab.com/blog/43/my-peeps-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
