<?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 &#187; ui</title> <atom:link href="http://www.csskarma.com/blog/tag/ui/feed/" rel="self" type="application/rss+xml" /><link>http://www.csskarma.com/blog</link> <description>display your style</description> <lastBuildDate>Tue, 31 Jan 2012 15:18:44 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Required input fields with JS fallback</title><link>http://www.csskarma.com/blog/required-input-fallback/</link> <comments>http://www.csskarma.com/blog/required-input-fallback/#comments</comments> <pubDate>Wed, 15 Jun 2011 01:22:26 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[forms]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=924</guid> <description><![CDATA[View the demo One of my favorite features of the HTML 5 forms is the &#8220;required&#8221; attribute. But unfortunately, support isn&#8217;t totally there yet. So we need to create fallbacks. It works in the modern browsers you&#8217;d expect it to (FF4, Safari, Opera, etc) but in older browsers, form validation isn&#8217;t something you can really [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.csskarma.com/lab/html5/input.required/">View the demo</a></p><p>One of my favorite features of the HTML 5 forms is the &#8220;required&#8221; attribute. But unfortunately, support isn&#8217;t totally there yet. So we need to create fallbacks.</p><p>It works in the modern browsers you&#8217;d expect it to (FF4, Safari, Opera, etc) but in older browsers, form validation isn&#8217;t something you can really ignore (like border-radius) or you&#8217;ll get flooded with all sorts of nastiness and spam. Sure we should be doing it at the server level anyway, but you still want that client side layer to add a bit of UX charm to your form.</p><p>We can still use the new required attribute effectively by creating a JavaScript fallback for unsupported browsers.</p><p>In this <a
href="http://www.csskarma.com/lab/html5/input.required/">demo</a>, I&#8217;m using:</p><ul><li><a
href="http://jquery.com/">jQuery</a></li><li><a
href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation</a></li><li><a
href="http://www.modernizr.com/">Modernizr</a></li></ul><h3>The HTML</h3><p>The HTML is very basic, just an HTML5 form, with 2 inputs: text (name), and email (email). I&#8217;m using 2 form types to show how we add classes to support the <a
href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation</a>. You can, of course, use whatever validation method you&#8217;d like.</p><pre><code>&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
&lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; required&gt;

&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;
&lt;input type=&quot;email&quot; name=&quot;email&quot; id=&quot;email&quot; required&gt;

&lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
&lt;/form&gt;</code></pre><h3>The JavaScript</h3><p>With the JavaScript, we first make the check for &#8220;required&#8221; support. I&#8217;m using <a
href="http://www.modernizr.com/">Modernizr</a> for this.</p><p>I left an open block in the if statement in case you want to do something else in there, but you could remove the <code>else</code> and replace the first line with it&#8217;s inverse <code>if (!Modernizr.input.required) {</code> if you don&#8217;t plan on using it for anything.</p><p>If &#8220;required&#8221; isn&#8217;t supported I&#8217;m running through all the form inputs on the page with a &#8220;required&#8221; attribute, adding a class of &#8220;required&#8221;, and the type of input (email, text, etc.). Setting the input type helps you use the validation plugin a little better and can also aid in styling for IE6.</p><p><strong>NOTE:</strong> I&#8217;m using JavaScript&#8217;s native getAttribute() method to grab the input type because  jQuery&#8217;s <code>attr('type')</code> returns &#8220;text&#8221; on the &#8220;email&#8221; input for some reason.</p><p>After all the appropriate classes are added, we can call the plugin. I&#8217;m doing it on each form, but targeting one specific form by it&#8217;s ID value is more traditional.</p><pre><code>(function ($) {

	<span>// check for "required" input support with modernizr</span>
	if (Modernizr.input.required) {

		<span>// do something else</span>

	} else {

		<span>// parse through each required input</span>
		$('form').find('input[required]').each(function () {

			<span>// add a class to each required field with "required" &#038; the input type</span>
			<span>// using the normal "getAttribute" method because jQuery's attr always returns "text"</span>
			$(this).attr('class', 'required ' + this.getAttribute('type')).removeAttr('required');

		});

		<span>// call jQuery validate plugin on each form</span>
		$('form').each(function () {
			$(this).validate();
		});

	}<span> // if required supported</span>

}(jQuery));</code></pre><p>Older (unsupported) browsers will use the Validation plugin, and modern browsers will use the built-in HTML 5 validation.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/required-input-fallback/feed/</wfw:commentRss> <slash:comments>2</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/jquery.plugins/jquery.slidinglabels.js">Plugin</a></li><li><a
href="http://www.csskarma.com/lab/jquery.plugins/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>61</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"><h3>Transcending CSS</h3><p><img
src="http://www.csskarma.com/images/transcendingcss.jpg" alt="Transcending CSS book cover" /></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>&nbsp;</p><div
class="book"><h3>Bulletproof Ajax</h3><p><img
src="http://www.csskarma.com/images/bulletproofajax.jpg" alt="Bulletproof Ajax book cover" /></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 <em>Bulletproof Ajax</em> 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>&nbsp;</p><div
class="book"><h3>101 Things I Learned in Architecture School</h3><p><img
src="http://www.csskarma.com/images/101things.jpg" alt="101 Things I Learned in Architecture School book cover" /></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>&nbsp;</p><div
class="book"><h3>Mobile Web Design</h3><p><img
src="http://www.csskarma.com/images/mobilewebdesign.jpg" alt="Mobile Web Design book cover" /></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 <em>Mobile Web Design</em>, Cameron talks about a plethora of devices and focuses on Web standards rather than cool things you can do.</p></div><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>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[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 and provide a [...]]]></description> <content:encoded><![CDATA[<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>116</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 the latest version 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 [...]]]></description> <content:encoded><![CDATA[<div
style="background: #fffcdB; padding: 10px; margin: 0 0 30px; border: 1px solid #bebf6b; clear: both; font-size: 16px;">Please use <strong>the latest version</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</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</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>144</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>Selectable RSS with SimplePie and jQuery</title><link>http://www.csskarma.com/blog/selectable-rss/</link> <comments>http://www.csskarma.com/blog/selectable-rss/#comments</comments> <pubDate>Mon, 17 Aug 2009 05:45:45 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[advanced]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[rss]]></category> <category><![CDATA[simplepie]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=632</guid> <description><![CDATA[I was building an RSS reader for a project last week and it turned out to be a cool little app. So I thought I&#8217;d share some of the code. View demo Download demo files Let&#8217;s start off with the HTML we need to get some user interaction with the form. It&#8217;s a pretty basic, [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.csskarma.com/images/articles/simplepieloader.jpg" alt="banner" /></p><p>I was building an RSS reader for a project last week and it turned out to be a cool little app. So I thought I&#8217;d share some of the code.</p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/">View demo</a></p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/simplepieloader.zip">Download demo files</a></p><p>Let&#8217;s start off with the HTML we need to get some user interaction with the form. It&#8217;s a pretty basic, just some of checkboxes.</p><p><img
src="http://www.csskarma.com/images/articles/simplepie_form.png" alt="form with 4 checkboxes" /></p><h5>HTML</h5><pre><code>&lt;form action="" method="post" id="selection"&gt;
  &lt;h2&gt;Choose your news sources&lt;/h2&gt;
 <span>&lt;!--
  Setting all the checkbox names to "source[] helps us build the array on submit"
  We're also adding the RSS feed url to the checkbox value so we can save it in the array values
  --&gt;</span>
  &lt;ul&gt;
  &lt;li&gt;&lt;input type="checkbox" id="csskarma" name="source[]" value="http://www.csskarma.com/blog/feed/"/&gt;&lt;label for="csskarma"&gt;CSSKarma&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="cnn" name="source[]" value="http://rss.cnn.com/rss/cnn_topstories.rss"/&gt;&lt;label for="cnn"&gt;CNN&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="espn" name="source[]" value="http://sports-ak.espn.go.com/espn/rss/news"/&gt;&lt;label for="espn"&gt;ESPN&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="vitamin" name="source[]" value="http://feeds.feedburner.com/vitaminmasterfeed"/&gt;&lt;label for="vitamin"&gt;Think Vitamin&lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;

  <span>&lt;!-- Setting the submit name to "btn" --&gt;</span>
  &lt;input type="submit" value="submit" name="btn" id="btn-submit"/&gt;
  &lt;/form&gt;
  &lt;/div&gt;&lt;!--/#selectnews--&gt;</code></pre><p>The only real thing worth noting in the form code are the names of the checkboxes. We use all the same name to group them together and the [ ] helps create the array on submit. I just chose to use <code>source[]</code> because it made sense to me, but you can use anything as long as the names are consistent and the brackets are there. Just adjust your PHP accordingly.</p><h5>SimplePie PHP</h5><pre><code>&lt;?php
<span>/* Get the SimplePie library */</span>
require_once ('inc/simplepie.inc');

<span>/* Create a new instance of SimplePie */</span>
$feed = new SimplePie();

<span>/* Get array */</span>
<span>// If the form has been submitted and the user selected news sources</span>
if (isset ($_POST['btn']) &amp;&amp; isset($_POST['source'])) {

    <span>// Save the array of news sources to a variable $checked</span>
    $checked = $_POST['source'];

    <span>// Pass the array of news sources through the SimplePie set_feed_url() function</span>
    $feed-&gt;set_feed_url($checked);

    <span>// Also, save this data to a cookie called "feedurls" that will expire when the browser closes</span>
    setcookie('feedurls', serialize($checked));

<span>// If the form wasn't submitted look for the "feedurls" cookie</span>
} else if (isset ($_COOKIE['feedurls'])) {

	<span>// If the cookie was found, pass the data through set_feed_urls()</span>
	$feed-&gt;set_feed_url(unserialize($_COOKIE['feedurls']));
}

<span>/* Set item limit */</span>
$feed-&gt;set_item_limit(3);

<span>/* Enable caching */</span>
$feed-&gt;enable_cache(true);

<span>/* Provide the caching folder */</span>
$feed-&gt;set_cache_location('cache');

<span>/* Set the amount of seconds you want to cache the feed */</span>
$feed-&gt;set_cache_duration(1800);

<span>/* I don't know what "init" means */</span>
$feed-&gt;init();

<span>/* Handle the content type (atom, RSS...) */</span>
$feed-&gt;handle_content_type();
?&gt;</code></pre><p>This is nothing that can&#8217;t be read in the comments, but the guts of the PHP comes in right under the &#8220;Get Array&#8221; comment. We&#8217;re checking to see if the form was submitted and the user selected news sources; if so, dump the values into SimplePie and save them to a cookie we can refer to later. The initial idea was for this to live at a pretty open place (a computer lab or something), that&#8217;s why the cookie expires on browser close.</p><p>I limited the per-feed output to 3 to keep it a little clean, but you can set that to whatever you want. It&#8217;d be pretty easy to let the user choose this as well with a select menu:</p><pre><code>&lt;select name="displayNumber"&gt;
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;option value="3"&gt;3&lt;/option&gt;
&lt;/select&gt;</code></pre><p>And replace <code>$feed-&gt;set_item_limit(3);</code> with <code>$feed-&gt;set_item_limit($_POST['displayNumber']);</code>. There may be some extra tweaking beyond that, but the general idea is to pass the submitted value into SimplePie.</p><h5>jQuery</h5><p>Now that we have the form fully functional we can layer some JavaScript on top of it to make it a little more <em>nifty</em>. This is using the <a
rel="external" href="http://malsup.com/jquery/form/">jQuery Form Plugin</a>. It&#8217;s the first time I&#8217;ve really used this plugin, but it&#8217;s actually pretty nice and easy to use. I had some little quirks with it, but nothing too major.</p><pre><code>$(function() {

<span>/* If JavaScript is active create a link to slide the form out */</span>
$('#getform a').click(function(){
	$('#selection').slideToggle('slow');
	return false;
});<span>//</span>

<span>/* make it look like something happened */</span>
$('#selection, #reader').hide(); <span>//</span>
$('#reader').fadeIn('slow'); <span>//</span>

<span> /* bind form using 'ajaxForm' */</span>
$('#selection').ajaxForm(options); 

<span>/* Submit form via Ajax */</span>
var options = {
    target:       '#rssloader',
}; <span>//</span>

});<span>// End jQuery</span></code></pre><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/">View demo</a></p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/simplepieloader.zip">Download demo files</a></p><p>Anyway, that&#8217;s all I have for today. It&#8217;s a pretty unpolished demo so let me know what you think, where I screwed up and if you can build on it and make it better. I&#8217;ll try to write some more soon.</p><h5>Ingredient list</h5><ul><li><a
rel="external" href="http://simplepie.org/downloads/">SimplePie</a></li><li><a
rel="external" href="http://css-tricks.com/video-screencasts/55-adding-rss-content-with-simplepie/">Starter files from CSS-Tricks</a></li><li><a
rel="external" href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&amp;downloadBtn=">jQuery</a></li><li><a
rel="external" href="http://malsup.com/jquery/form/">jQuery Form Plugin</a></li><li><a
href="http://sharkcool.net" rel="external">Hill&#8217;s Brain</a></li><li>Coffee</li></ul> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/selectable-rss/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Usable Accessibility</title><link>http://www.csskarma.com/blog/usable-accessibility/</link> <comments>http://www.csskarma.com/blog/usable-accessibility/#comments</comments> <pubDate>Tue, 14 Apr 2009 15:38:57 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Standards]]></category> <category><![CDATA[accessibility]]></category> <category><![CDATA[quote]]></category> <category><![CDATA[ui]]></category> <category><![CDATA[usability]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=488</guid> <description><![CDATA[Many times focusing on standards and guidelines puts the focus on the technical aspects of accessibility, and the human interaction aspect is lost. This problem can be avoided by adopting the broader definition of accessibility as a guiding principle. Instead of focusing only on the technical aspects of accessibility, it is important to recognize that [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.csskarma.com/images/articles/usable-accessibility.jpg" alt="article banner"/></p><blockquote
cite="http://www.uiaccess.com/upa2002a.html"><p>Many times focusing on standards and guidelines puts the focus on the technical aspects of accessibility, and the human interaction aspect is lost. This problem can be avoided by adopting the broader definition of accessibility as a guiding principle. Instead of focusing only on the technical aspects of accessibility, it is important to recognize that usability is also an important aspect of accessibility. Consciously addressing ‘usable accessibility’ helps clarify the difference between what meets minimum accessibility standards and what is usable by people with disabilities.<cite>Shawn Henry</cite></p></blockquote><p>Following my trail of articles I read through this morning to find this quote:</p><ul><li><a
href="http://www.456bereastreet.com/archive/200904/accessibility_is_more_than_possible_to_access/" rel="external">Accessibility is more than &quot;possible to access&quot;</a></li><li><a
href="http://www.uxmatters.com/mt/archives/2009/02/usable-accessibility-making-web-sites-work-well-for-people-with-disabilities.php" rel="external">Usable Accessibility: Making Web Sites Work Well for People with Disabilities</a></li><li><a
href="http://www.uiaccess.com/upa2002a.html" rel="external">Accessibility Primer for Usability Specialists</a></li></ul><p>There were all pretty good reads, if I had to pick 1, I&#8217;d say definitely read through the second one, it covers all the bases for you.</p><p>I think when building a site or application with accessibility in mind my thoughts are usually something like&#8221; &quot;I&#8217;ll do the best I can to make this easy for the blind to access, but essentially there&#8217;s only so much I can do, it&#8217;s gonna be tough&quot;. I understand the need to get out of that mind set, maybe investing in a screenreader is the answer?</p><p>I&#8217;m not entirely sure quite yet how to create a better user experience for a disable user. Especially since I still can&#8217;t get the damn mac voice thing to function in a useful way. Hopefully that answer will come sooner rather than later.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/usable-accessibility/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Form Security with Autocomplete</title><link>http://www.csskarma.com/blog/autocomplete-off/</link> <comments>http://www.csskarma.com/blog/autocomplete-off/#comments</comments> <pubDate>Fri, 10 Apr 2009 15:57:04 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[forms]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=480</guid> <description><![CDATA[I was looking through my blog this morning because I could have sworn I already wrote this post. I know I&#8217;ve had this conversation with Phil Nash of Unintentionally Blank. But I guess I never wrote it down? Oh well&#8230; One of my pet peeves when filling out a form is when I click in [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.csskarma.com/images/articles/autocomplete.jpg" alt="article banner"/></p><p>I was looking through my blog this morning because I could have sworn I already wrote this post. I know I&#8217;ve had this conversation with Phil Nash of <a
href="http://www.unintentionallyblank.co.uk/">Unintentionally Blank</a>. But I guess I never wrote it down? Oh well&#8230;</p><p>One of my pet peeves when filling out a form is when I click in the payment field and my credit crard / bank account number drops down because it was saved in the browser from last time I made a payment on that site. How is it that developers on these sites overlook that <strong>huge</strong> security issue?</p><p>There&#8217;s a very simple fix for it, and it&#8217;s called &#8220;autocomplete off&#8221;:</p><h5>The XHTML</h5><pre><code>&lt;input id="pmt" name="payment" type="text" autocomplete="off"/&gt;</code></pre><p>The <code>autocomplete="off"</code> makes sure the text field doesn&#8217;t expose any saved data. Of course, it would be too easy if this was valid XHTML so it&#8217;s not. If you&#8217;re concerned with writing 100% valid XHTML, there are valid ways to do this.</p><h4>Writing valid code</h4><p>To make this valid, we need to do it with JavaScript. Since I&#8217;m pretty sure most people who read this are jQuery freaks (like me), I&#8217;ll show the jQuery version of this:</p><h5>The XHTML</h5><pre><code>&lt;input id="pmt" name="payment" type="text" /&gt;</code></pre><h5>The jQuery</h5><pre><code>$(function() {
$("input#pmt").attr("autocomplete","off");
});</code></pre><h4>The problem with added security with JavaScript</h4><p>I don&#8217;t really recommend using javaScript for this, only because it&#8217;s easily disabled. And then you&#8217;re back at square one with the payment info dropping down in the text field</p><p>Ideally, I&#8217;d like to use PHP to do this, but I can&#8217;t find it anywhere so I&#8217;m using &lt;noscript&gt;:</p><h5>The jQuery</h5><pre><code>$(function() {
$("form#paymentform").html("&lt;input id="pmt" name="payment" type="text" autocomplete="off"/&gt;);
});</code></pre><h5>The XHTML (placed inside the form)</h5><pre><code>&lt;label for="pmt"&gt;Credit Card Number&lt;/label&gt;
&lt;noscript&gt;</code><code>&lt;input id="pmt" name="payment" type="text" autocomplete="off"/&gt;</code><code>&lt;/noscript&gt;</code></pre><p>That way, if javascript is enabled you&#8217;ll use the jQuery to write the textfield, and if it&#8217;s not, you&#8217;ll just write it out normally, which will be invalid, but more secure.</p><p>Let me know if anyone knows the PHP way to check for JS.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/autocomplete-off/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Analyzing Home</title><link>http://www.csskarma.com/blog/analyzing-home/</link> <comments>http://www.csskarma.com/blog/analyzing-home/#comments</comments> <pubDate>Wed, 08 Apr 2009 05:03:09 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=417</guid> <description><![CDATA[The &#8220;Home&#8221; link has been a staple on almost all of the Web sites I&#8217;ve made in the past 5 years, but lately I&#8217;ve been wondering how important it is. I heard Steve Krug at An Event Apart Boston 2007 talk about how the &#8220;home&#8221; link should always be list first in your navigation, but [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.csskarma.com/images/articles/analyzing-home.jpg" alt="article banner"/></p><p>The &#8220;Home&#8221; link has been a staple on almost all of the Web sites I&#8217;ve made in the past 5 years, but lately I&#8217;ve been wondering how important it is.</p><p>I heard <a
href="http://www.sensible.com/">Steve Krug</a> at <a
href="http://aneventapart.com/events/boston07/">An Event Apart Boston 2007</a> talk about how the &#8220;home&#8221; link should always be list first in your navigation, but do we really even need it at all?</p><p>All the way back in 2000 <a
href="http://www.useit.com">Jakob Nielsen</a> challenged the notion that <a
href="http://www.useit.com/alertbox/20000109.html">we need main navigation</a> on a site. While I do think navigation is important (for most sites), I&#8217;m not so sure about the link labeled &#8220;Home&#8221;. Most of the major sites we all visit have them, but how often are they used?</p><p><img
src="http://www.csskarma.com/images/articles/homelinks.jpg" alt="home link images" style="float:left;margin:0 10px 10px 0;"/></p><p>Let&#8217;s face it, the home page is even starting to die off. With the influx of RSS and sites like <a
href="http://www.digg.com">digg</a>, <a
href="http://www.stumbleupon.com">stumbleupon</a>, <a
href="http://www.delicious.com">delicious</a>, and countless others, it&#8217;s very likely that a user will never even see your home page. They&#8217;ll just jump from article to article through their RSS reader or the latest and greatest from <a
href="http://www.digg.com">Digg</a> (if you can be so lucky).</p><p>UI and user-centric design is so important right now, it has us re-thinking everything about Web development and how we design a site. As I build a site now, I actually stop and analyze every piece of a site from time to time. Everything from the search function to the contents of the footer.</p><p>I hear a lot of complaints from users of sites that don&#8217;t have their logo linked up to the home page, but I&#8217;ve never heard a complaint from someone navigating a site without a home link.</p><p
class="clear">There are some popular sites that have already adopted this style of navigation:</p><ul><li><a
href="http://www.espn.com">ESPN</a></li><li><a
href="http://www.bbc.co.uk/">BBC</a></li><li><a
href="http://www.alistapart.com/">A List Apart</a></li><li><a
href="http://www.amazon.com/">Amazon</a></li></ul><p>Only the logo will get you to the home page&#8230; but i&#8217;m sure someone out there will scour those sites for an exception</p><p>I think, at this point in the Web, it&#8217;s perfectly acceptable to drop the &#8220;Home&#8221; link and use your logo as the only means to get back to your home page. But next time you&#8217;re putting together a site, really ask yourself: is a &#8220;Home&#8221; link is adding anything to the user experience, or is it just taking up space?</p><p>I&#8217;m pretty sure mine&#8217;s just taking up space.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/analyzing-home/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 5/14 queries in 0.140 seconds using disk: basic

Served from: www.csskarma.com @ 2012-02-09 15:43:23 -->
