<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>lowfatcode</title>
	<atom:link href="http://lowfatcode.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lowfatcode.wordpress.com</link>
	<description>the Atkins diet of software development blogging</description>
	<lastBuildDate>Sat, 05 Dec 2009 20:58:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lowfatcode.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>lowfatcode</title>
		<link>http://lowfatcode.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lowfatcode.wordpress.com/osd.xml" title="lowfatcode" />
	<atom:link rel='hub' href='http://lowfatcode.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Firefox getComputedStyle() bug?</title>
		<link>http://lowfatcode.wordpress.com/2009/12/04/firefox-getcomputedstyle-bug/</link>
		<comments>http://lowfatcode.wordpress.com/2009/12/04/firefox-getcomputedstyle-bug/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:19:52 +0000</pubDate>
		<dc:creator>lowfatcode</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://lowfatcode.wordpress.com/?p=10</guid>
		<description><![CDATA[One nice interface feature in Internet Explorer is that &#60;select&#62; elements take on the style of the currently selected &#60;option&#62; providing the user with better visual feedback about their selection. Often I like to include a &#8220;Please select&#8230;&#8221; option as the first item in dropdown lists that don&#8217;t have a sensible default selection. Using a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lowfatcode.wordpress.com&amp;blog=10811943&amp;post=10&amp;subd=lowfatcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One nice interface feature in Internet Explorer is that &lt;select&gt; elements take on the style of the currently selected &lt;option&gt; providing the user with better visual feedback about their selection.</p>
<p>Often I like to include a &#8220;Please select&#8230;&#8221; option as the first item in dropdown lists that don&#8217;t have a sensible default selection. Using a pale font colour for this option makes it clear to the user that they have not yet made their choice.</p>
<div id="attachment_11" class="wp-caption aligncenter" style="width: 230px"><a href="http://lowfatcode.files.wordpress.com/2009/12/colour-pickers.png"><img class="size-full wp-image-11" title="Colour pickers (Internet Explorer on the left, Firefox on the right)" src="http://lowfatcode.files.wordpress.com/2009/12/colour-pickers.png?w=220&#038;h=152" alt="Colour pickers example" width="220" height="152" /></a><p class="wp-caption-text">Colour pickers (Internet Explorer on the left, Firefox on the right)</p></div>
<p>Unfortunately it turns out that getComputedStyle() in Firefox always returns rgb( 255, 255, 255 ) when called on an &lt;option&gt; element. So this doesn&#8217;t work&#8230;</p>
<pre class="brush: jscript; light: true;">jQuery( &quot;#myselect&quot; ).css( &quot;color&quot;, document.defaultView.getComputedStyle( jQuery( &quot;#myselect option:selected&quot; )[ 0 ], null ) );</pre>
<p>&#8230;because the return result isn&#8217;t actually the right colour.</p>
<p>The workaround is a cludge and requires that you define your colours on each &lt;option&gt; element explicitly with inline CSS and access them through the css() function in jQuery (avoiding the need for getComputedStyle() altogether). Yuck!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lowfatcode.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lowfatcode.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lowfatcode.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lowfatcode.wordpress.com&amp;blog=10811943&amp;post=10&amp;subd=lowfatcode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lowfatcode.wordpress.com/2009/12/04/firefox-getcomputedstyle-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/26c0b355aa6bcbb9b6fd77bddaed6c66?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jw</media:title>
		</media:content>

		<media:content url="http://lowfatcode.files.wordpress.com/2009/12/colour-pickers.png" medium="image">
			<media:title type="html">Colour pickers (Internet Explorer on the left, Firefox on the right)</media:title>
		</media:content>
	</item>
	</channel>
</rss>
