<?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>Jasongraphix &#187; HTML</title>
	<atom:link href="http://jasongraphix.com/journal/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasongraphix.com</link>
	<description>A journal of art, thoughts, and projects by Jason Beaird.</description>
	<lastBuildDate>Mon, 13 Feb 2012 15:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Title-Based Textbox Hints</title>
		<link>http://jasongraphix.com/journal/title-based-textbox-hints/</link>
		<comments>http://jasongraphix.com/journal/title-based-textbox-hints/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:35:12 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[textbox]]></category>

		<guid isPermaLink="false">http://jasongraphix.com/?p=595</guid>
		<description><![CDATA[Time to rethink my old method of displaying textbox hints with background images. That method still works fine for compact login forms, but what if we have several textboxes on a page with different hints that may need changing. I don&#8217;t want to have to create/maintain images for each textbox hint, so I&#8217;d rather use [...]]]></description>
			<content:encoded><![CDATA[<p>Time to rethink <a href="http://jasongraphix.com/journal/textbox-hints/">my old method</a> of displaying textbox hints with background images. That method still works fine for compact login forms, but what if we have several textboxes on a page with different hints that may need changing. I don&#8217;t want to have to create/maintain images for each textbox hint, so I&#8217;d rather use text. Where should I get that text from though? I could use the label text, but sometimes that needs to be different from the hint. Take this search field for instance:</p>
<p><img src="http://static.jasongraphix.com/uploads/txbhint-search.jpg" class="border" width="450" height="42" alt="Textbox Hint Example" /></p>
<p>The label here would be &#8220;Search:&#8221;, but in the hint I want to give the user some examples of data they can search for. A great place to put this hint information is the title attribute of the textbox. For users without JavaScript, hovering an input with a title will show them a tooltip of the hint. Using jQuery though, we can enhance the experience quite a bit:</p>
<pre>
$('input.txbhint').focus(function() {
	if ($(this).val() == "" || $(this).val() == $(this).attr('title')){
		$(this).val("").removeClass("hinted");
	}
}).blur(function() {
	if ($(this).val() == "") {
		$(this).val($(this).attr('title')).addClass("hinted");
	}
}).filter(function() {
	if ($(this).val() == "" || $(this).val() == $(this).attr('title')){
		$(this).val($(this).attr('title')).addClass("hinted");
	}
});
</pre>
<p></p>
<p>The jQuery code above simply sets the input&#8217;s title text as it&#8217;s value and colors it gray (via the &#8220;hinted&#8221; class) until the user focuses on it. When they do, the value gets removed and the text color gets set to black. If the user leaves the textbox and the value is still blank, we cleverly reset the text with the title text again and change the color back to gray. </p>
<p><a href="http://jasongraphix.com/sandbox/textboxhints/" rel="external">View the Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/title-based-textbox-hints/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Anchor Link Toggle</title>
		<link>http://jasongraphix.com/journal/anchor-link-toggle/</link>
		<comments>http://jasongraphix.com/journal/anchor-link-toggle/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 17:50:24 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[progressive enhancement]]></category>
		<category><![CDATA[sliding]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/anchor-link-toggle/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I enjoy enhancing webpages with Javascript as much as anyone, but there is a lot to be said for making things function just as well with plain ole&#8217; HTML.  Recently, I was marking up a design that included a box on the homepage that toggled between 2 states. I could have made the non-javascript fallback simply link to a modified version of the homepage that showed one or the other, but that would require an unnecessary page refresh. Instead, I put both sets of information in a div with overflow set to hidden. I then used anchor links to slide the contents of the div up and down to show the selected information. Confused? Check out the <a href="/sandbox/anchorlinktoggle/">anchor link toggle demo</a>.</p>
<p><a href="/sandbox/anchorlinktoggle/" class="nostyle" title="View the Demo"><img src="http://static.jasongraphix.com/uploads/anchorlinktoggle.png" border="0" width="420" height="200" alt="Anchor link toggle demo screenshot" /></a></p>
<p>I&#8217;m certain this isn&#8217;t an original idea, but I haven&#8217;t ever seen anyone blog about it&#8230;probably because I don&#8217;t even really know what this technique should be called. Accessible toggle boxes, sliding anchor content, fairy-dustless slight of hand? Help me out here.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/anchor-link-toggle/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

