<?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>CSSKarma</title>
	<atom:link href="http://www.csskarma.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csskarma.com/blog</link>
	<description>display your &#60;style&#62;</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:56:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Our Curious Future with QR Codes</title>
		<link>http://www.csskarma.com/blog/qr-codes/</link>
		<comments>http://www.csskarma.com/blog/qr-codes/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 01:56:30 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[qr codes]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=841</guid>
		<description><![CDATA[Often, when I write something for CSSKarma I try and make it unique rather than picking up the hot topic and throwing my2cents in about it. You may have noticed the lack of HTML 5 posts, even though I spoke at the Penn UI Conference about it. There&#8217;s actually quite a bit buried in the [...]]]></description>
			<content:encoded><![CDATA[<p>Often, when I write something for CSSKarma I try and make it unique rather than picking up the hot topic and throwing my2cents in about it. You may have noticed the lack of HTML 5 posts, even though I <a href="http://csskarma.com/presentations/penn">spoke at the Penn UI</a> Conference about it. There&#8217;s actually quite a bit buried in the <a href="http://www.csskarma.com/lab">Lab</a> that will surface when I launch the new design.</p>
<p>Anyway, I&#8217;ve been playing around with QR codes lately. Seeing what sort of information can be stored in them, if they&#8217;re a viable technology for the masses, and if they&#8217;re worth investing in. I thought I&#8217;d share my findings.</p>
<h3>What is a QR code?</h3>
<p><img class="left" style="margin: 0 10px 10px 0;" src="/images/articles/qrcode.png" alt="hello qr code from csskarma.com" /></p>
<p>A QR code is much like a bar code, but they look a lot cooler and in theory can contain a lot more, and a wider variety of information. Everything from plain text to contact information and URLs. They&#8217;re actually very robust and there&#8217;s a ton of cool stuff we can do if they ever actually catch on and reach the public.</p>
<p>Most modern phones will have an available app for decoding QR codes. I&#8217;m not sure about Blackberry, but I know Android, iPhone and Palm all have free apps.</p>
<p>I put together a QR code generator based on the <a href="http://code.google.com/apis/chart/">Google Charts API</a> if you&#8217;d like to play around:</p>
<ul class="demo">
<li><a href="http://www.csskarma.com/lab/qrcodes/">View Demo</a></li>
</ul>
<h3>What can we use them for?</h3>
<p>QR codes can be used for all sorts of things. Anytime you want to transfer data, a QR code can be used. I&#8217;m sure there are some limitations on the amount of data, but I haven&#8217;t encountered it yet. Many times a URL is embedded into the code and then the user is sent out to the Web for more information. This is basically a shortcut to help you get to the data without having to type in a URL (it&#8217;s actually a pretty big time saver).</p>
<p>One of the best use-cases for QR codes I&#8217;ve seen has been attaching them to a venue. For example: If, on the side of a building, you found a QR code you could decode it to find a calendar of events going on in that building, then choose which ones to add to your calendar, set reminders, etc. All by simply taking a picture of a QR code. Again, a bit time saver.</p>
<p>Since the QR code can basically be an extension of the Web, the possibilities are endless. The problem is&#8230; how will we let people know they exist? It&#8217;s not a problem in the Web community, but based on the speed most technologies like this are adopted, it could be a while.</p>
<h3>Are they viable for the masses?</h3>
<p>This is always a debate with a &#8220;geek technology&#8221;. We can use them, they&#8217;re very helpful at conferences for passing contact information from person to person or the location of presentation slides. But will everyone else use them? Probably not.</p>
<p>Don&#8217;t get me wrong, they&#8217;re a great technology with endless uses, but I&#8217;m not sure they&#8217;re going to catch on in the way we&#8217;d like. They&#8217;re pretty strange, and no one really knows what they are. They have a along road ahead,  much like the way RSS quietly became popular. I think they&#8217;ll have the same fate in never really being a main stream technology, but stil very popular behind the scenes.</p>
<p>For some reason, these free technologies really struggle but the second Apple charges 99 cents, they take off like a rocket. Here&#8217;s hoping QR codes make the next Steve Jobs talk?</p>
<h3>Are they worth investing in?</h3>
<p>They are absolutely, 100% worth investing in. The upside of QR codes far outweighs the downside. The <a href="http://www.csskarma.com/lab/qrcodes">QR Code Generator</a> I built took all of 2 hours to fully develop and launch. Most of that time was reading through the Google Charts documentation and testing out all the options.</p>
<p>I don&#8217;t see any reason we shouldn&#8217;t explore QR codes more, they have a very promising future and I look forward to see what we can make happen, especially when combined with RDFa, Microformats , and some of the new HTML 5 data embedding.</p>
<h4>The upside</h4>
<p>Everyone loves it, you&#8217;re a genius and you get piles of money handed to you on a daily basis for doing something innovative.</p>
<h4>The downside</h4>
<p>Most people many not get it, so they get the information the &#8220;old fashion way&#8221;. The worst-case scenario is that it totally fails and you wasted 2 hours. It&#8217;s very much like progressive enhancement for real-life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/qr-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sliding Labels Official Plugin Release [ver. 3.2]</title>
		<link>http://www.csskarma.com/blog/sliding-labels-plugin/</link>
		<comments>http://www.csskarma.com/blog/sliding-labels-plugin/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 12:27:23 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascipt]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=805</guid>
		<description><![CDATA[View Demo Plugin Minified Plugin Version: 3.2 – Added a &#8220;className&#8221; option so you don&#8217;t have to use &#8220;.slider&#8221; as the wrapper Version 3.1: Changed &#8220;children&#8221; to &#8220;find&#8221; so it will work with a UL. Thanks to Oro for the feedback Version 3 of Sliding Labels brought some big changes, the largest being that I [...]]]></description>
			<content:encoded><![CDATA[<div id="slidinglabels-plugin-release">
<ul class="demo">
<li><a href="http://www.csskarma.com/lab/plugin_slidinglabels/">View Demo</a></li>
<li><a href="http://www.csskarma.com/lab/plugin_slidinglabels/js/jquery.slidinglabels.js">Plugin</a></li>
<li><a href="http://www.csskarma.com/lab/plugin_slidinglabels/js/jquery.slidinglabels.min.js">Minified Plugin</a></li>
</ul>
<p><strong>Version: 3.2 – Added a &#8220;className&#8221; option so you don&#8217;t have to use &#8220;.slider&#8221; as the wrapper</strong></p>
<p>Version 3.1: Changed &#8220;children&#8221; to &#8220;find&#8221; so it will work with a UL. Thanks to <a href="http://www.csskarma.com/blog/sliding-labels-plugin/comment-page-1/#comment-85490">Oro</a> for the feedback</p>
<p>Version 3 of Sliding Labels brought some big changes, the largest being that I finally converted it into a working jQuery plugin.</p>
<p>Maybe it was the 200 e-mails requesting an official plugin, maybe it was my curiosity. Whatever it was, I heard everyone and I wanted to let you know that I&#8217;m listening to all the feature requests and bug reports; and I really do appreciate them.</p>
<h3>Additions to version 3</h3>
<p><strong>Plugin status</strong>: Obviously creating an official plugin was the biggest change</p>
<p><strong>Position: relative</strong>: It seemed like a lot of the questions I was getting had to do with adding <code>position:relative</code> to the .slider element in the CSS, so I just moved that into the script.</p>
<p><strong>Animation speed</strong>: I added an option to easily control the animation speed. It can take strings like &#8220;fast&#8221; and &#8220;slow&#8221; or any numeric value.</p>
<p><strong>Axis option</strong>: I got a lot of requests to add in some functionality to have the label slide up rather than only to the left. I added this in with an &#8220;axis&#8221; variable which can take either &#8220;x&#8221; or &#8220;y&#8221; for sliding direction</p>
<h3>Subtractions to version 3</h3>
<p><strong>Label Color</strong>: Originally I had this in the script so it looked nicer inline to the field, but I got to thinking that this really should be defined in the CSS, and it&#8217;s just color; so I took it out.</p>
<h3>Using the plugin</h3>
<p>Just like the previous version, you need an element wrapping the <code>&lt;label&gt;</code> and <code>&lt;input&gt;</code> elements. I use a <code>&lt;div&gt;</code> in the demo, but you can use whatever you&#8217;d like. The only requirement is that it have the class name &#8220;slider&#8221;. I can change that if anyone finds it to be annoying, but <strong>let me know and I&#8217;ll update the script</strong></p>
<h4>HTML</h4>
<pre><code>&lt;div class="form-slider"&gt;
&lt;label for="user"&gt;User name&lt;/label&gt;
&lt;input type="text" id="user" name="user"&gt;
&lt;/div&gt;</code></pre>
<h4>JavaScript</h4>
<pre><code>$(function(){

	$('#contactform').slidinglabels({

		/* these are all optional */
                className    : 'form-slider', // the class you're wrapping the label &amp; input with -&gt; default = slider
		topPosition  : '5px',  // how far down you want each label to start
		leftPosition : '5px',  // how far left you want each label to start
		axis         : 'x',    // can take 'x' or 'y' for slide direction
		speed        : 'fast'  // can take 'fast', 'slow', or a numeric value

	});

});</code></pre>
<p>That&#8217;s all there is to it. Let me know what you think, any extra features you&#8217;d like and any bugs. I should be submitting this to <a href="http://jquery.com">jQuery.com</a> in the next few days.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/sliding-labels-plugin/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Books that made me a better designer</title>
		<link>http://www.csskarma.com/blog/books/</link>
		<comments>http://www.csskarma.com/blog/books/#comments</comments>
		<pubDate>Fri, 07 May 2010 17:46:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sketching]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=819</guid>
		<description><![CDATA[This is a list of books that have had a big impact on the way I design &#38; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else. Transcending [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list of books that have had a big impact on the way I design &amp; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else.</p>
<div class="book">
	<a href="http://www.transcendingcss.com/"></p>
<h3>Transcending CSS</h3>
<p>        <img src="http://www.csskarma.com/img/transcendingcss.jpg" alt="Transcending CSS book cover"><br />
        </a></p>
<p class="author"><a href="http://www.stuffandnonsense.co.uk/">Andy Clarke</a></p>
<p class="desc">Andy&#8217;s book is obviously very technically good and well written. I certainly got a lot of information like that out of it, but at this point you can find most of it on various blogs. My biggest take away was how Andy spoke about semantics. Specifically using IDs like &#8220;branding&#8221; and &#8220;site-info&#8221; rather than &#8220;header&#8221; and &#8220;footer&#8221;. Up to that point I had just been using &#8220;header&#8221; and &#8220;footer&#8221; because it was how it was done at the time. Andy got me thinking heavily about semantics and naming schema and also opened up a lot of doors for me to really examine how I put together a site instead of blindly do it because it&#8217;s what I&#8217;ve heard is the best.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://bulletproofajax.com/"></p>
<h3>Bulletproof Ajax</h3>
<p>        <img src="http://www.csskarma.com/img/bulletproofajax.jpg" alt="Bulletproof Ajax book cover"><br />
        </a></p>
<p class="author"><a href="http://adactio.com/">Jeremy Keith</a></p>
<p class="desc">I read this book right around the time I began playing with <a href="http://jquery.com">jQuery</a> and it made me realize that, however great a library like jQuery may be, it won&#8217;t be around forever and if I don&#8217;t learn how it really works, I&#8217;ll be screwed when it finally disappears like so many other Web technologies. In <i>Bulletproof Ajax</i> I learned how exactly the XMLHTTPRequest worked, what jQuery was doing, and how it made it so easy to work with, all while keeping Web standards in sight and never putting something together that couldn&#8217;t function without JavaScript.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://www.amazon.com/101-Things-Learned-Architecture-School/dp/0262062666"></p>
<h3>101 Things I Learned in Architecture School</h3>
<p>        <img src="http://www.csskarma.com/img/101things.jpg" alt="101 Things I Learned in Architecture School book cover"><br />
        </a></p>
<p class="author"><a href="http://www.frederickdesignstudio.com/">Matthew Frederick</a></p>
<p class="desc">Drawing lines seems like a stupid thing to want to learn, but that&#8217;s what this book effectively taught me. I learned the importance of some very basic design principles and how to effectively communicate those ideas to others through certain shapes and sketching techniques. <strong>This is a great book</strong>. I really got into it after a talk by <a href="http://www.lukew.com/">Luke Wroblewski</a> at the Web App Summit in Newport Beach.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://mobilewebbook.com/"></p>
<h3>Mobile Web Design</h3>
<p>        <img src="http://www.csskarma.com/img/mobilewebdesign.jpg" alt="Mobile Web Design book cover"><br />
        </a></p>
<p class="author"><a href="http://cameronmoll.tumblr.com/">Cameron Moll</a></p>
<p class="desc">The first book to really spark my interest in the Mobile Web. Ever since reading it I&#8217;ve felt like I have a slight edge whenever beginning a project with mobile requirements. Most mobile books now focus on intense graphics and acceleration of devices like the iPhone. In <i>Mobile Web Design</i>, Cameron talks about a plethora of devices and focuses on Web standards rather than cool things you can do.</p>
</div>
<p><!--/.book--></p>
<p>Obviously, I highly recommend all those these books, as they&#8217;ve had a pretty large impact on me as a designer &amp; a developer. The best part about them is that they&#8217;re all pretty easy reads, they&#8217;re not the kind of books you have to spend a week or 2 reading.</p>
<p>Does anyone else have books like this? Or do we all just read blogs now?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Penn UI Conference &amp; HTML 5</title>
		<link>http://www.csskarma.com/blog/penn-ui-conference-html-5/</link>
		<comments>http://www.csskarma.com/blog/penn-ui-conference-html-5/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 22:52:41 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=797</guid>
		<description><![CDATA[I&#8217;m speaking at the upcoming Penn UI Conference July 21 &#38; 22 in Philadelphia this year. It&#8217;s a great conference with a high profile history of speakers, so I was definitely honored to have been asked to contribute. My talk will be on HTML 5, and loosely based on my Smashing Magazine article: HTML 5 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/pennuiconf.png" alt="Penn UI Conference" /></p>
<p>I&#8217;m speaking at the upcoming <a href="http://www.pennuiconf.org/">Penn UI</a> Conference July 21 &amp; 22 in Philadelphia this year. It&#8217;s a great conference with a high profile history of speakers, so I was definitely honored to have been asked to contribute.</p>
<p>My talk will be on HTML 5, and loosely based on my Smashing Magazine article: <a href="http://www.smashingmagazine.com/2009/07/16/html5-and-the-future-of-the-web/">HTML 5 and the Future of the Web</a>. I&#8217;ll be up there for close to an hour and a half, so I&#8217;m hoping to cover a lot of the ins and outs of HTML 5.</p>
<p>Much like I did in the article, I&#8217;ll be talking about the new elements, APIs, use cases and probably touch on Mobile as well.</p>
<h3>Official description</h3>
<blockquote><p>HTML 5 and the future of the Web will explore the new monster on the block, HTML 5. It will present a broad overview of the new structural elements you&#8217;ll be dealing with, various APIs built into the language, and what you can expect to encounter as you move forward with HTML 5.</p>
<p>We&#8217;ll talk about how it is currently being implemented, how it may be implemented in the future, and how HTML 5 can create a more personalized and enriched experience across multiple platforms while saving development time.</p>
<p>We&#8217;ll also look into ways you can start using HTML 5 right now, what you can do to prepare for the transition and how we can apply some of those methods to academia.</p></blockquote>
<h3>People smarter than me</h3>
<p>There&#8217;s a huge speaker list for the conference, the likes of which include:</p>
<ul>
<li><a href="http://boxofchocolates.ca/">Derek Featherstone</a></li>
<li><a href="http://jeffcroft.com/">Jeff Croft</a></li>
<li><a href="http://www.usabilityworks.net/">Dana Chisnell</a></li>
<li><a href="http://www.jnd.org/">Don Norman</a></li>
</ul>
<p>I won&#8217;t list them all, but they have a <a href="http://web.wharton.upenn.edu/uiconf2010/speakers.cfm">full list of speakers</a> if you want. A lot of great minds will be there. I&#8217;m looking forward to not only speaking, but also attending. Should be a great time.</p>
<p>Hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/penn-ui-conference-html-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sliding Labels v2 &#8211; Patch</title>
		<link>http://www.csskarma.com/blog/sliding-labels-v2/</link>
		<comments>http://www.csskarma.com/blog/sliding-labels-v2/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 15:51:37 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=772</guid>
		<description><![CDATA[window.location = "http://www.csskarma.com/blog/sliding-labels-plugin/" Please use version 3 of sliding labels with updated options and bug fixes at: http://www.csskarma.com/blog/sliding-labels-plugin/ Last week I wrote an article about sliding form labels that got quite a bit of attention. Many of the commenters brought up a couple good points/bug in the Sliding Label code that I wanted to address [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/banner_slidinglabel2.jpg" alt="banner"></p>
<p><script>
window.location = "http://www.csskarma.com/blog/sliding-labels-plugin/"
</script></p>
<div style="background: #fffcdB; padding: 10px; margin: 0 0 30px; border: 1px solid #bebf6b; clear: both; font-size: 16px;">Please use <strong>version 3</strong> of sliding labels with updated options and bug fixes at: <a href="http://www.csskarma.com/blog/sliding-labels-plugin/">http://www.csskarma.com/blog/sliding-labels-plugin/</a></div>
<p>Last week I wrote an article about sliding form labels that got quite a bit of attention. Many of the commenters brought up a couple good points/bug in the Sliding Label code that I wanted to address and provide a patch for:</p>
<ul>
<li>The sliding label was barfing out in <strong>Safari</strong> when auto-fill was active</li>
<li>The default scripting didn&#8217;t work on <strong>textareas</strong></li>
</ul>
<p>I sat down yesterday and wrote a patch/new version of sliding labels which I think addresses these two problems.</p>
<p class="demo"><a href="http://www.csskarma.com/lab/plugin_slidinglabels/">View the Demo</a></p>
<h3>The new jQuery</h3>
<pre><code>$(function(){
$('form#info .slider label').each(function(){
	var labelColor = '#999';
	var restingPosition = '5px';

	<span>// style the label with JS for progressive enhancement</span>
	$(this).css({
		'color' : labelColor,
		 	'position' : 'absolute',
	 		'top' : '6px',
			'left' : restingPosition,
			'display' : 'inline',
    		        'z-index' : '99'
	});

	var inputval = $(this).next().val();

	<span>// grab the label width, then add 5 pixels to it</span>
	var labelwidth = $(this).width();
	var labelmove = labelwidth + 5 +'px';

	<span>// onload, check if a field is filled out, if so, move the label out of the way</span>
	if(inputval !== ''){
		$(this).stop().animate({ 'left':'-'+labelmove }, 1);
	}    	

	<span>// if the input is empty on focus move the label to the left
	// if it's empty on blur, move it back</span>
	$('input, textarea').focus(function(){
		var label = $(this).prev('label');
		var width = $(label).width();
		var adjust = width + 5 + 'px';
		var value = $(this).val();

		if(value == ''){
			label.stop().animate({ 'left':'-'+adjust }, 'fast');
		} else {
			label.css({ 'left':'-'+adjust });
		}
	}).blur(function(){
		var label = $(this).prev('label');
		var value = $(this).val();

		if(value == ''){
			label.stop().animate({ 'left':restingPosition }, 'fast');
		}	

	});
}); <span>// End "each" statement</span>
}); <span>// End loaded jQuery</span></code></pre>
<h3>Textarea HTML</h3>
<p>The HTML for the textarea follows the same convention as the rest of the inputs, in only needing a wrapping element.</p>
<pre><code>&lt;div id="comment-wrap"  class="slider"&gt;
    &lt;label for="comment"&gt;Comment&lt;/label&gt;
    &lt;textarea cols="53" rows="10" id="comment"&gt;&lt;/textarea&gt;
&lt;/div&gt;&lt;!--/#comment-wrap--&gt;</code></pre>
<p>There are no major changes to the plugin, just a few tweaks. If you find anymore bug, please let me know.</p>
<p class="demo"><a href="http://www.csskarma.com/lab/plugin_slidinglabels/">View the Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/sliding-labels-v2/feed/</wfw:commentRss>
		<slash:comments>115</slash:comments>
		</item>
		<item>
		<title>Redirection Options</title>
		<link>http://www.csskarma.com/blog/redirection-options/</link>
		<comments>http://www.csskarma.com/blog/redirection-options/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:40:58 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=736</guid>
		<description><![CDATA[Lately, I&#8217;ve been having to work with a lot of redirects and I was going through different redirection options with a client. So I thought I would do a quick write up about the different types of redirection. I also haven&#8217;t seen a collection of these in one place, so I thought I would put [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/banner_redirection.png" alt="article banner"></p>
<p>Lately, I&#8217;ve been having to work with a lot of redirects and I was going through different redirection options with a client. So I thought I would do a quick write up about the <strong>different types of redirection</strong>.</p>
<p>I also haven&#8217;t seen a collection of these in one place, so I thought I would put this together.</p>
<p>There are a few different types that are commonly use when redirecting users:</p>
<ul>
<li>.htaccess / apache</li>
<li>php header</li>
<li>javascript</li>
<li>meta refresh</li>
</ul>
<p>The top two are the one&#8217;s you&#8217;ll be using most often, I don&#8217;t really recommend the last two. But they <em>are</em> available, so I think they&#8217;re worth noting. So here they are in the order I would recommend: </p>
<h3>.htaccess / apache redirects</h3>
<pre><code>Redirect /old_directory http://example.com/newdirectory</code></pre>
<p>This redirection is most efficient at the apache level, but if you&#8217;re like me and are on shared hosting, getting into the apache installation probably isn&#8217;t an option. In that case you can put this in an <a href="http://www.csskarma.com/blog/creating-an-htaccess-template/">.htaccess file</a> in the root directory of your site.</p>
<p>Using an .htaccess redirection is great for moving entire sites because you can not only redirect a page, but you can redirect entire sites and subdirectories with one line of code.</p>
<h3>PHP header redirects</h3>
<pre><code>&lt;?php header('Location: http://example.com/newdirectory/'); ?&gt;</code></pre>
<p>PHP header redirects are good for single page redirects and if you&#8217;re not comfortable working with the .htaccess file. This code goes at the very top of the page you&#8217;re trying to redirect. If it&#8217;s not there you may get a &#8220;headers already sent&#8221; error.</p>
<p>If you&#8217;re publishing out static HTML files, you can still use this by adding this code into your .htaccess file:</p>
<pre><code>AddType application/x-httpd-php .php .html .htm</code></pre>
<p>This will let you <strong>execute PHP in an HTML file</strong>.</p>
<h3>JavaScript redirects</h3>
<pre><code>&lt;script type="text/javascript"&gt;
&lt;!--
window.location = "http://example.com/newdirectory"
//--&gt;
&lt;/script&gt;</code></pre>
<p>JavaScript redirects are generally not used unless you&#8217;ve exhausted the other two options. If you don&#8217;t have access to the .htaccess file AND you can&#8217;t run server-side script on your page, this is an OK fallback option, but you have to make sure to provide a link to the forwarding page incase a user is browsing without JavaScript.</p>
<h3>Meta redirects</h3>
<pre><code>&lt;meta http-equiv="refresh" content="0;URL=http://example.com/newdirectory"&gt;</code></pre>
<p>As your last option, I don&#8217;t see this in the wild anymore, but it&#8217;s worth mentioning that it does exist and does technically work (I&#8217;m not sure about it&#8217;s validity in HTML 5). You would place this in the document HEAD with the rest of the meta elements.</p>
<p>content=0 is a second timer for the redirect, I have this one set to 0 so it will redirect immediately.</p>
<p><strong>Those are the options I&#8217;ve used in the past; did I miss anything? Maybe an ASP redirect? Let me know!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/redirection-options/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Form Design with Sliding Labels</title>
		<link>http://www.csskarma.com/blog/sliding-labels/</link>
		<comments>http://www.csskarma.com/blog/sliding-labels/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:01:56 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=689</guid>
		<description><![CDATA[Please use version 3 of sliding labels with updated options and bug fixes at: http://www.csskarma.com/blog/sliding-labels-plugin/ A few weeks ago I was reading an article on form UI by Luke Wroblewski of Yahoo!. For those who aren&#8217;t familiar with Luke, he (quite literally) wrote the book on good form design. In the article, one certain section [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/banner_slidinglabel.jpg" alt="Sliding Label banner"></p>
<div style="background:#fffcdB;padding:10px;margin:0 0 30px;border:1px solid #bebf6b;clear:both;font-size:16px;">Please use <strong>version 3</strong> of sliding labels with updated options and bug fixes at: <a href="http://www.csskarma.com/blog/sliding-labels-plugin/">http://www.csskarma.com/blog/sliding-labels-plugin/</a></div>
<p>A few weeks ago I was reading an <a href="http://www.lukew.com/ff/entry.asp?968">article</a> on form UI by <a href="http://www.lukew.com/">Luke Wroblewski</a> of <a href="http://www.yahoo.com/">Yahoo!</a>.  For those who aren&#8217;t familiar with Luke, he (<a href="http://rosenfeldmedia.com/books/webforms/">quite literally</a>) wrote the book on good form design.</p>
<p>In the article, one certain section about placing labels inside of form fields stood out to me:</p>
<blockquote cite="http://www.lukew.com/ff/entry.asp?968"><p>Because labels within fields need to go away when people are entering their answer into an input field, the context for the answer is gone. So if you suddenly forget what question you’re answering, tough luck—the label is nowhere to be found. As such, labels within inputs aren’t a good solution for long or even medium-length forms. When you’re done filling in the form, all the labels are gone! That makes it a bit hard to go back and check your answers. <cite>Luke Wroblewski</cite></p></blockquote>
<p>He brings up a good point. Generally speaking, you can look at a field that says &#8220;Tim Wright&#8221; and know that it was a field for your (my) name. But for long forms, yea, I do agree that you can forget some of the questions you answered.</p>
<p>For best practice, Luke talks about leaving your labels outside the form field so it&#8217;s always available to the user. I do think it&#8217;s a pretty good solution, but <strong>I think we can get a little more creative than that</strong>.</p>
<h3>Enter: Sliding Labels</h3>
<p>After reading that article it occurred to me that there&#8217;s no reason we can&#8217;t have the best of both worlds. I like how inline labels look, and I see Luke&#8217;s point about them disappearing as you fill out the form. But, we have jQuery, we know about progressive enhancement, and we have creative minds, so let&#8217;s build something that allows us to keep the label inline, but <strong>slide it off to the left</strong> (or up, whichever you prefer) rather than going away on click.</p>
<p class="demo"><a href="http://www.csskarma.com/lab/plugin_slidinglabels/">View demo (version 2)</a></p>
<h4>The HTML</h4>
<pre><code>&lt;form action="" method="post" id="info"&gt;
   &lt;h2&gt;Contact Information&lt;/h2&gt;
   &lt;div id="name-wrap" class="slider"&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;
      &lt;input type="text" id="name" name="name"&gt;
   &lt;/div&gt;<span>&lt;!--/#name-wrap--&gt;</span>

   &lt;div id="email-wrap"  class="slider"&gt;
      &lt;label for="email"&gt;E&amp;ndash;mail&lt;/label&gt;
      &lt;input type="text" id="email" name="email"&gt;
   &lt;/div&gt;<span>&lt;!--/#email-wrap--&gt;</span>

   &lt;div id="street-wrap"  class="slider"&gt;
      &lt;label for="st"&gt;Street&lt;/label&gt;
      &lt;input type="text" id="st" name="st"&gt;
   &lt;/div&gt;<span>&lt;!--/#street-wrap--&gt;</span>

   &lt;div id="city-wrap"  class="slider"&gt;
      &lt;label for="city"&gt;City &amp;amp; State&lt;/label&gt;
      &lt;input type="text" id="city" name="city"&gt;
   &lt;/div&gt;<span>&lt;!--/#city-wrap--&gt;</span>

   &lt;div id="zip-wrap"  class="slider"&gt;
      &lt;label for="zip"&gt;Zip code&lt;/label&gt;
      &lt;input type="text" id="zip" name="zip"&gt;
   &lt;/div&gt;<span>&lt;!--/#zip-wrap--&gt;</span>

   &lt;input type="submit" id="btn" name="btn" value="submit"&gt;
&lt;/form&gt;</code></pre>
<p>The only necessary items to make sliding labels (as I built it) work are the wrapper element (<code>DIV</code> in my case) and applying a class of &#8220;slider&#8221; to it (you can change this easily in the JavaScript).</p>
<p>At this point we have a pretty basic, and ugly form</p>
<p><img src="http://www.csskarma.com/blog/wp-content/uploads/slidinglabels_nocss.png" alt="slidinglabels no css" /></p>
<h4>The CSS</h4>
<pre><code>body                       { font:12px/1.3 Arial, Sans-serif; }
form                       { width:380px;padding:0 90px 20px;margin:auto;background:#f7f7f7;border:1px solid #ddd; }
div                        { clear:both;position:relative;margin:0 0 10px; }
label                      { cursor:pointer;display:block; }
input[type="text"]         { width:300px;border:1px solid #999;padding:5px;-moz-border-radius:4px; }
input[type="text"]:focus   { border-color:#777; }
input[name="zip"]          { width:150px; }

/* submit button */
input[type="submit"]       { cursor:pointer;border:1px solid #999;padding:5px;-moz-border-radius:4px;background:#eee; }
input[type="submit"]:hover,
input[type="submit"]:focus { border-color:#333;background:#ddd; }
input[type="submit"]:active{ margin-top:1px; }
</code></pre>
<p>The only 100% necessary CSS in there is the <code>position:relative</code> on the wrapper element (<code>DIV</code>). The rest is basically cosmetic and you can mess with it as you see fit.</p>
<p>At this point you should have a pretty normal looking form with labels on top of their respective inputs.</p>
<p><img src="http://www.csskarma.com/blog/wp-content/uploads/labelslider_nojs.png" alt="labelslider no js" /></p>
<h4>The jQuery</h4>
<p>Now for the section everyone skipped to, provided you didn&#8217;t go straight to the demo (which I usually do).</p>
<pre><code>$(function(){
$('form#info .slider label').each(function(){
	var labelColor = '#999';
	var restingPosition = '5px';

	<span>// style the label with JS for progressive enhancement</span>
	$(this).css({
		'color' : labelColor,
		 	'position' : 'absolute',
	 		'top' : '6px',
			'left' : restingPosition,
			'display' : 'inline',
    	               'z-index' : '99'
	});

	<span>// grab the input value</span>
	var inputval = $(this).next('input').val();

	<span>// grab the label width, then add 5 pixels to it</span>
	var labelwidth = $(this).width();
	var labelmove = labelwidth + 5;

	<span>//onload, check if a field is filled out, if so, move the label out of the way</span>
	if(inputval !== ''){
		$(this).stop().animate({ 'left':'-'+labelmove }, 1);
	}    	

	<span>// if the input is empty on focus move the label to the left</span>
	<span>// if it's empty on blur, move it back</span>
	$('input').focus(function(){
		var label = $(this).prev('label');
		var width = $(label).width();
		var adjust = width + 5;
		var value = $(this).val();

		if(value == ''){
			label.stop().animate({ 'left':'-'+adjust }, 'fast');
		} else {
			label.css({ 'left':'-'+adjust });
		}
	}).blur(function(){
		var label = $(this).prev('label');
		var value = $(this).val();
		if(value == ''){
			label.stop().animate({ 'left':restingPosition }, 'fast');
		}
	});
})
});</code></pre>
<p>At this point, you should have a fully working sliding label form!</p>
<p><img src="http://www.csskarma.com/blog/wp-content/uploads/labelslider_final.png" alt="labelslider final" /></p>
<p class="demo"><a href="http://www.csskarma.com/lab/plugin_slidinglabels/">View demo (version 2)</a></p>
<p>Making sure everything is still usable without JavaScript is important (no matter what people say), it&#8217;s just a basic principle of progressive enhancement. Believe it or not, there are still people browsing without JavaScript (blackberry users &#8211; turned off by default). So creating the interaction in layers, as we did, will help it be <strong>past-proof</strong>.</p>
<p>Try it out and let me know what you think. So far I&#8217;ve used it on a password change form, so definitely let me know if you find a place to use it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/sliding-labels/feed/</wfw:commentRss>
		<slash:comments>143</slash:comments>
		</item>
		<item>
		<title>Conditional Animation Speed in jQuery</title>
		<link>http://www.csskarma.com/blog/conditional-animation-speed/</link>
		<comments>http://www.csskarma.com/blog/conditional-animation-speed/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 17:00:43 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=694</guid>
		<description><![CDATA[For years (and by &#8220;years&#8221;, I most likely mean &#8220;the years since I started using jQuery&#8230; maybe 2&#8243;), there&#8217;s been one aspect of jQuery that&#8217;s bugged the crap out of me, the animation speed. View demo We&#8217;ve all probably seen the problem that happens in many drop down menus of varying height. We set slideDown(300) [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/turtle.jpg" alt="Turtle"></p>
<p>For years (and by &#8220;years&#8221;, I most likely mean &#8220;the years since I started using jQuery&#8230; maybe 2&#8243;), there&#8217;s been one aspect of jQuery that&#8217;s bugged the crap out of me, the animation speed.</p>
<p class="demo"><a href="http://www.csskarma.com/lab/animation_speed/">View demo</a></p>
<p>We&#8217;ve all probably seen the problem that happens in many drop down menus of varying height. We set <code>slideDown(300)</code> (or whatever you set it to) on all the submenus and leave like that. Inevitably, menus grow and shrink based on the content and we get this weird and mildly annoying behavior of really fast moving tall menus vs. shorter menus that move painfully slow just because there&#8217;s not much content in there.</p>
<p>This problem stems from where we set the speed of the animation; the value isn&#8217;t actually a speed, it&#8217;s how long it takes (in milliseconds, I think) for the animation to finish. So you can see why you get varying behaviors based on the element height.</p>
<p>It&#8217;s true, that you can use the built-in speed values like &#8220;fast&#8221; and &#8220;slow&#8221;, but if you want more fine-grained control over your animation, you&#8217;ll have to use a value.</p>
<h3>Problem Child <a href="http://us.imdb.com/title/tt0100419/">&#8734;</a></h3>
<p>This is what our problem menu looks like all collapsed, just 2 clickable headings (<code>h2</code>) that will slide open to expose content (<code>p</code>)</p>
<p><img src="http://www.csskarma.com/blog/wp-content/uploads/animation_collapsed.png" alt="animation collapsed"></p>
<p>Normally our jQuery would look something like this:</p>
<pre><code>$(function(){

$('h2').toggle(function(){
    <span>/* get the next element */</span>
    var next_element = $(this).next();

    <span>/* open it  if it's closed */</span>
    next_element.slideDown(500);
},function(){
    <span>/* get the next element again */</span>
    var next_element = $(this).next();

    <span>/* close it if it's open */</span>
    next_element.slideUp(500);
});

});</code></pre>
<p>Note: just example code, I didn&#8217;t check to see if it actually works</p>
<p>This is our menu fully expanded. As you can see, the first item has a lot more content then the second. Using the code above will make menu #1 move noticeably faster than menu #2; which, to me, creates an odd user experience. Because you&#8217;re like &#8220;Why&#8217;s is moving so slow?&#8221;</p>
<p><img src="http://www.csskarma.com/blog/wp-content/uploads/animation_expanded.png" alt="animation expanded" /></p>
<p>So let&#8217;s see if we can&#8217;t fix that.</p>
<h3>Ben Healy (Solution) <a href="http://us.imdb.com/name/nm0000615/">&#8734;</a></h3>
<p>What we&#8217;re looking to do here is <strong>get the height</strong> of each collapsed item, do some JS math, and set a speed (animation time) value based on the height.</p>
<h4>jQuery functions we&#8217;ll need</h4>
<ul>
<li><a href="http://docs.jquery.com/Traversing/next">next()</a></li>
<li><a href="http://docs.jquery.com/CSS/height">height()</a></li>
<li><a href="http://docs.jquery.com/Effects/slideUp">slideDown()</a> / <a href="http://docs.jquery.com/Effects/slideDown">slideUp()</a></li>
</ul</p>
<h4>The Code</h4>
<pre><code>$(function(){

	<span>/* Variables to set */</span>
	var id = '#heightCheck';
	var click_element = 'h2';
	var height_value = '100';
	var tall_menu_speed = 400;
	var short_menu_speed = 250;

	<span>/* System variables, probably don't change */</span>
	var target = id +' '+ click_element;
	var menu_content = $(target).next();

	<span>/* Hide the element after the click_element, whether it's a
	div, p, ul, whatever you choose to wrap the items in */</span>
	menu_content.hide();

	$(target).toggle(function(){
		<span>/* save the menu items in a variable */</span>
		var this_menu = $(this).next();

		<span>/* get the menu height and save it */</span>
		var menu_height = this_menu.height();

		<span>/* Calculate the animation speed based on the element height */
		/* if the height is greater than the height set above use the
		tall menu height */</span>
		if(menu_height > height_value){
			var speed = tall_menu_speed;

		<span>/* If it's smaller, use the short menu height */</span>
		} else if(menu_height < height_value) {
			var speed = short_menu_speed;
		}

		<span>/* slide the menu down */</span>
		this_menu.slideDown(speed);

	},function(){
		<span>/* this is the same but reversed to close the menu */</span>
		var this_menu = $(this).next();
		var menu_height = $(this).next().height();

		<span>/* Calculate the animation speed based on the element height */</span>
		if(menu_height > height_value){
			var speed = tall_menu_speed;
		} else if(menu_height < height_value) {
			var speed = short_menu_speed;
		}
		this_menu.slideUp(speed);

	});

});</code></pre>
<p>That should give you a little more control over the menu speed. I'm sure it needs to be tweaked based on the menu you're using, but the general concept is there, and it should work pretty well. I hope it was helpful. Let me know if you have any additions to the code or suggestions to improve it.</p>
<p class="demo"><a href="http://www.csskarma.com/lab/animation_speed/">View demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/conditional-animation-speed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What You Need to Know About Behavioral CSS</title>
		<link>http://www.csskarma.com/blog/behavioral-css/</link>
		<comments>http://www.csskarma.com/blog/behavioral-css/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:46:32 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[smashing magazine]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=681</guid>
		<description><![CDATA[Hi all, I had a new article published over the weekend at Smashing Magazine. Check it out and let me know what you think! Behavioral CSS I wrote it quite a while ago and it seems to be showing a bit in the comments, but overall, I&#8217;m pretty happy with the way it came out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/smashing-banner1.png" alt="" title="smashing-banner" class="article-banner"/></p>
<p>Hi all,<br />
I had a new article published over the weekend at Smashing Magazine. Check it out and let me know what you think!</p>
<p><a href="http://www.smashingmagazine.com/2009/12/19/what-you-need-to-know-about-behavioral-css/">Behavioral CSS</a></p>
<p>I wrote it quite a while ago and it seems to be showing a bit in the comments, but overall, I&#8217;m pretty happy with the way it came out and the reader responses it&#8217;s getting. Hope you enjoy <a href="http://www.smashingmagazine.com/2009/12/19/what-you-need-to-know-about-behavioral-css/">Behavioral CSS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/behavioral-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Techniques I Wish I Knew When I Started Designing Websites</title>
		<link>http://www.csskarma.com/blog/css-techniques-i-wish-i-knew-when-i-started-designing-websites/</link>
		<comments>http://www.csskarma.com/blog/css-techniques-i-wish-i-knew-when-i-started-designing-websites/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 15:30:42 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[noupe]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=675</guid>
		<description><![CDATA[I know I haven&#8217;t posted in a while, but I wanted to stop by and let everyone know that I have a new article out on Noupe.com called &#8220;CSS Techniques I Wish I Knew When I Started Designing Websites&#8221; It was pretty fun to write trying to think back to my beginnings in the Web [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/noupeheader.png" alt="noupeheader" title="noupeheader" width="580" height="176" class="article-banner" /></p>
<p>I know I haven&#8217;t posted in a while, but I wanted to stop by and let everyone know that I have a new article out on <a href="http://www.noupe.com/css/css-techniques-i-wish-i-knew-when-i-started-designing-websites.html">Noupe.com</a> called &#8220;<a href="http://www.noupe.com/css/css-techniques-i-wish-i-knew-when-i-started-designing-websites.html">CSS Techniques I Wish I Knew When I Started Designing Websites</a>&#8221;</p>
<p>It was pretty fun to write trying to think back to my beginnings in the Web and sort of relive that frustration. I tried to include something for beginners and some for the more advanced users, so hopefully everyone will be able to take something away from the article.</p>
<p>Let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/css-techniques-i-wish-i-knew-when-i-started-designing-websites/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.186 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-03 15:09:46 -->
