<?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>Catch My Fame &#187; Usability</title>
	<atom:link href="http://www.catchmyfame.com/category/usability/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.catchmyfame.com</link>
	<description>A web designoper&#039;s journal</description>
	<lastBuildDate>Thu, 02 Feb 2012 14:18:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Before/After 1.4 Released</title>
		<link>http://www.catchmyfame.com/2011/09/20/beforeafter-1-4-released/</link>
		<comments>http://www.catchmyfame.com/2011/09/20/beforeafter-1-4-released/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 16:05:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=916</guid>
		<description><![CDATA[Version 1.4 of the Before/After plugin has been released with a new feature &#8211; keyboard navigation. Now you can use your left and right arrow keys to move the image divider. By default this option has been disabled. There are actually two new option parameters, enableKeyboard and keypressAmount. The first, enableKeyboard, can be set to [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.4 of the <a title="jQuery Before/After Plugin" href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/">Before/After</a> plugin has been released with a new feature &#8211; keyboard navigation. Now you can use your left and right arrow keys to move the image divider. By default this option has been disabled. There are actually two new option parameters, enableKeyboard and keypressAmount. The first, enableKeyboard, can be set to true or false to enable keyboard navigation and the second, keypressAmount, is the number of pixels you want the divider to move each time the arrow is pressed. The main reason for setting enableKeybaord to false was for those running multiple instances of the plugin on a page. If the default was true, than a press of the arrow key would move the divider on all instances.</p>
<p>Visit the <a title="jQuery Before/After Plugin" href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/">Before/After plugin page</a> to download the latest version and try out the demos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/09/20/beforeafter-1-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Loading Indicator to the Before/After Plugin</title>
		<link>http://www.catchmyfame.com/2011/09/15/adding-a-loading-indicator-to-the-beforeafter-plugin/</link>
		<comments>http://www.catchmyfame.com/2011/09/15/adding-a-loading-indicator-to-the-beforeafter-plugin/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 13:36:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=908</guid>
		<description><![CDATA[Sometimes you may not be able to pre-load the images you&#8217;re using with the before/after plugin. In that situation you may want to give your visitors some indication that the images are loading so that they&#8217;re not left scratching their heads wondering if there&#8217;s a problem. Fortunately with a little jQuery and CSS you can [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may not be able to pre-load the images you&#8217;re using with the <a title="jQuery Before/After Plugin" href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/">before/after plugin</a>. In that situation you may want to give your visitors some indication that the images are loading so that they&#8217;re not left scratching their heads wondering if there&#8217;s a problem. Fortunately with a little jQuery and CSS you can add a loading indicator to the before/after plugin.</p>
<h3>The jQuery</h3>
<p>After the jQuery code to instantiate the plugin, add (assuming a container with the id of &#8220;conjainer&#8221;):</p>
<pre id="line1">$('#container').prepend('&lt;p id="loader"&gt;Loading...&lt;/p&gt;');
$('#container &gt; div:eq(2) &gt; img').load(function() {
	$('#loader').remove();
});</pre>
<h3>The CSS</h3>
<p>Then add some styling. Here we&#8217;re adding an animated loading gif:</p>
<pre id="line1">#container {
	border:2px solid #666;
}
#loader {
	background: #e9e9e9 url(ajax-loader.gif) no-repeat 50% 50%;
	margin:0;
	padding:0;
	width:100%;
	height:100%;
}</pre>
<p>And that&#8217;s it! Note that this is just a basic example and it only tests for one of the two images being loaded, however it&#8217;s basic to extend this concept further and even provide more feedback to the user.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/09/15/adding-a-loading-indicator-to-the-beforeafter-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New jQuery Plugin &#8211; The Page Carousel</title>
		<link>http://www.catchmyfame.com/2011/08/08/new-jquery-plugin-the-page-carousel/</link>
		<comments>http://www.catchmyfame.com/2011/08/08/new-jquery-plugin-the-page-carousel/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 12:37:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=876</guid>
		<description><![CDATA[jQuery Page Carousel Plugin About a year ago I was asked to create a plugin that allowed visitors to navigate a series of web pages without having to ever actually leave one page. What I came up with I&#8217;m calling the Page Carousel plugin. The Page Carousel allows you to take an unordered list and [...]]]></description>
			<content:encoded><![CDATA[<h1>jQuery Page Carousel Plugin</h1>
<p>About a year ago I was asked to create a plugin that allowed visitors to navigate a series of web pages without having to ever actually leave one page. What I came up with I&#8217;m calling the Page Carousel plugin. The Page Carousel allows you to take an unordered list and turn each item into its own page.</p>
<p>Features:</p>
<ul>
<li>Turns an unordered list into a web page carousel. Have an entire website run from one page.</li>
<li>Each &#8220;page&#8221; is bookmarkable and can be linked to directly</li>
<li>Shortest path algorithm finds the shortest path to the selected page. For example, in a seven page site if you navigate from page 2 to page 7, the carousel slides to the right three pages instead of to the left five pages.</li>
<li>Peek effect. Allows users to see part of the previous and next pages.</li>
<li>Keyboard navigation. Use the left and right arrows to navigate.</li>
<li>Customizable navigation links and arrow images.</li>
<li>Resizes with browser.</li>
<li>Separate left/right easing effects</li>
<li>Callback functions</li>
<li>Degradable. No JavaScript? No problem!</li>
</ul>
<h2>Download</h2>
<ul>
<li><strong><a href="http://www.catchmyfame.com/jquery/pagecarousel/jquery.pagecarousel.js" target="_blank">jquery.pagecarousel.js</a> (13k)</strong></li>
</ul>
<h2 id="demo">Demos</h2>
<ul>
<li><a href="http://www.catchmyfame.com//jquery/pagecarousel/index.html" target="_blank">Example 1</a> &#8211; Small peek applied</li>
<li><a href="http://www.catchmyfame.com//jquery/pagecarousel/index2.html" target="_blank">Example 2</a> &#8211; Embedded video and alternate navigation options</li>
</ul>
<p>View each demo&#8217;s source code for options and styling.</p>
<h2>How to Use</h2>
<p>Build an unordered list and wrap it in a div with an ID. Point to jQuery and the plugin (using an easing plugin is optional):</p>
<pre id="line1">&lt;script type="text/javascript" src="jquery-1.6.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.easing.1.3.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.pagecarousel.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(function(){
    $('#container').pageCarousel({
        nextPrevImagePath: 'images/nextprev.png',
        transitionSpeed:500,
        padding:'10px',
        peekAmount: '20px',
        showLinks: true,
        pageWidth: '800px',
        linkPosition: 'top',
        easeLeft: 'easeInOutExpo',
        easeRight: 'easeInOutExpo'
    });
});
&lt;/script&gt;</pre>
<div>That&#8217;s it!</p>
<h2>Options</h2>
<p>The following options are configurable:</p>
<ul>
<li>viewDuration: the time (in milliseconds) to pause between a completed image and the next image (default: 4000)</li>
<li>transitionSpeed:  the time (in milliseconds) to complete a page transition (default: 800)</li>
<li>showLinks: Boolean value of whether to display navigation links based on each list item&#8217;s title attribute (default: true)</li>
<li>showArrows: Boolean value of whether to display navigation arrow images (default: true),<br />
links: Which side of the page navigation links should be displayed (left, right, both (default) )</li>
<li>linkPosition: Where navigation links should be placed on the page (under (default), top, or bott0m)</li>
<li>navWidth: Width of the navigation links (default &#8217;60px&#8217;)</li>
<li>navHeight: Height of the navigation links (default &#8217;20px&#8217;)</li>
<li>pageWidth: The width of the &#8220;page&#8221; container (default $(document).width())</li>
<li>easeLeft: The easing effect used when moving all pages to the left (default &#8216;linear&#8217;)</li>
<li>easeRight: The easing effect used when moving all pages to the right (default &#8216;linear&#8217;)</li>
<li>nextPrevImagePath: Path to arrow sprite (default &#8216;/js/pagecarousel/images/nextprev.png&#8217;)</li>
<li>nextPrevImageSize: The width and height of the arrow navigation sprite image (default {&#8216;width&#8217;:96,&#8217;height&#8217;:48})</li>
<li>padding: The amount of padding to apply to each page (default  &#8217;0px&#8217;)</li>
<li>peekAmount: The amount of the previous and next pages to hint at (default  &#8217;0px&#8217;)</li>
<li>scrollContainer: Boolean value of whether to wrap the pages in a div to force a scroll bar to appear directly next to the pages instead of on the browser window (default false)</li>
<li>onSlideStart: A callback function.</li>
<li>onSlideEnd: A callback function.</li>
</ul>
<h2>Easing</h2>
<p>While you can use whatever easing effects you like, I&#8217;ve found that the best effects are: easeOutCubic, easeInQuart, and easeOutExpo with a one second or less duration. I&#8217;m not crazy about easeInElastic, easeInOutElastic, easeInBounce, easeOutBounce, and easeInOutBounce, but feel free to experiment. Note that easeOutElastic, easeInBack, easeOutBack, and easeInOutBack can produce some interesting (if not odd) results.</p>
<p>Enjoy!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/08/08/new-jquery-plugin-the-page-carousel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What&#8217;s a Namespace?</title>
		<link>http://www.catchmyfame.com/2011/08/02/whats-a-namespace/</link>
		<comments>http://www.catchmyfame.com/2011/08/02/whats-a-namespace/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 15:34:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=869</guid>
		<description><![CDATA[You may have heard the term &#8220;namespace&#8221; and had a vague idea (or no idea whatsoever) what it referred to. A namespace is a coding term that pops up from time to time as something you should probably know about but don&#8217;t have to get through your day. Knowing when to use a namespace is [...]]]></description>
			<content:encoded><![CDATA[<p>You may have heard the term &#8220;namespace&#8221; and had a vague idea (or no idea whatsoever) what it referred to. A namespace is a coding term that pops up from time to time as something you should probably know about but don&#8217;t have to get through your day. Knowing when to use a namespace is both a good coding practice and a courtesy to other developers. In this article I&#8217;ll give you an overview about what a namespace is and how it works with a focus on JavaScript.<span id="more-869"></span></p>
<p>A namespace is essentially a wrapper for your code&#8217;s variables, functions, constants, and classes. This wrapper prevents &#8220;collisions&#8221; (a.k.a. clashes, conflicts, etc.) with other people&#8217;s code. For example, if you grab a script from a site and drop it into your web page you might find that for some reason that the script doesn&#8217;t work. Or you may discover that code you wrote, which worked before you dropped in this new code, has stopped working. After doing some debugging you determine the problem stems from both you and the person who wrote the script you grabbed are using the same variable names purely by accident. Your code works fine on its own, as does this script you grabbed; however because you both inadvertently used the same name for a variable, one of your variables is being overwritten by the other. For example, you both may have used a variable named<em> firstName</em>. Now while this might not be hard to fix, it can be time consuming and frustrating to track these kinds of errors down. Plus, simply renaming the conflicting variables can lead to other errors springing up. With more and more developers writing code to be shared, the odds only increase that someone will step on someone else&#8217;s code. This is where namespaces come in.</p>
<p>Namespaces basically wrap all your variables in a tidy package so that you can use whatever names you like without them colliding with someone else&#8217;s variables. A key step is to give your namespace a unique name because if your namespace has the same name as someone else&#8217;s namespace, well pretty much the universe will implode on itself. But fear not, it&#8217;s far easier to change a namespace&#8217;s name in the event of duplication than it is to replace all the instances of one or more variables in your code.</p>
<p>Again, while namespaces are not required, they can be an extremely valuable tool.</p>
<h3>JavaScript Namespaces</h3>
<p>By default, variables in JavaScript are global in scope unless they&#8217;re defined within a function using the var declaration. This means that you can access a variable anywhere in a script since they are within the global namespace. Variables defined within functions using the var declaration (e.g. var foo = 2;) are only accessible from within that function. By creating your own namespace you segregate your variables from the global namespace and prevent other code from accidentally accessing them, similar to the way using the var declaration in a function segregates that variable from being accesses from outside of that function. If you and I both write code that use a variable named <em>firstName</em> and then include both scripts on the same page, one of the scripts will overwrite the other&#8217;s use of <em>firstName</em>. As the book <em>JavaScript the Definitive Guide</em> states, &#8220;If you want to write a module of JavaScript code that can be used by any script and can be used with any other module, the most important rule you must follow is to avoid defining global variables. Anytime you define a global variable, you run the risk of having that variable overwritten by another module or by the programmer who is using your module. The solution instead is to define all the methods and properties for your module inside a namespace that you create specifically for the module.&#8221;</p>
<p>One of the easiest and most widely-used methods for defining your own namespace in JavaScript is to use an object. For example,</p>
<pre>var superspace = {};</pre>
<p>creates an empty JavaScript object which can then be used as our namespace. In the past we might assign a value to our firstName variable like</p>
<pre>var firstName = "John";</pre>
<p>however by using an object we can now do the same thing via</p>
<pre>superspace.firstName = "John";</pre>
<p>You can also place functions in your namespace object in a similar way. For example,</p>
<pre>superspace.getFirstName = function() {
return superspace.firstName
};</pre>
<p>The only real difference when using namespaces is that you prefix the name of the namespace object (superspace) to the variable name. This little change is what allows us to encapsulate our variables and keep them protected. It&#8217;s also possible to create your namespace object and your variables and functions at the same time. For example, using the same code as before you could write:</p>
<pre>var superspace = {
    firstName : "John",
    getFirstName : function() {return superspace.firstName}
};
document.write(superspace.getFirstName()); // outputs "John"</pre>
<p>Now, superspace.firstName and superspace.getFirstName are available globally within our page, however collisions won&#8217;t occur unless someone else is also using an object with both the same name (superspace) and the same variables (firstName and getFirstName).</p>
<p>Another way to create a namespace is through self-executing or self-invoking functions. Self-executing and self-invoking functions are simply anonymous functions (no explicit name) that are executed immediately after they are read by the browser. For example:</p>
<pre>var superspace = (function() {
var firstName = "John";
var getFirstName = function(){return firstName};
    return {getFirstName:getFirstName};
})();
document.write(superspace.getFirstName()); // outputs "John"</pre>
<p>A self-invoking function is a normal function, just with a set of parentheses appended to the end. The set of parentheses at the end tell the browser to execute the function just as if you were invoking a normal, named function (e.g. getFirstName();). Since self-invoking functions aren&#8217;t reusable, they&#8217;re really not functions in the truest sense since functions are meant to be reused. To differentiate self-invoking functions from normal functions, it&#8217;s recommended that self-invoking functions are wrapped in parentheses. To be honest, I prefer the simple object method of namespacing over the self-invoking function method because it&#8217;s easier to read and needs less code to accomplish the same task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/08/02/whats-a-namespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey Google. Where&#8217;s My Toolbar for Firefox 5?</title>
		<link>http://www.catchmyfame.com/2011/07/07/hey-google-wheres-my-toolbar-for-firefox-5/</link>
		<comments>http://www.catchmyfame.com/2011/07/07/hey-google-wheres-my-toolbar-for-firefox-5/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 20:31:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=861</guid>
		<description><![CDATA[It&#8217;s been what, like three weeks now and you still haven&#8217;t updated the toolbar to work with Firefox 5?  What&#8217;s the deal? Update (July 22, 2011): This kinda pisses me off. Apparently Google is dropping support for the Google Toolbar in Firefox 5+ (“Therefore, while Google Toolbar for Firefox works on versions up to and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been what, like three weeks now and you <em>still </em>haven&#8217;t updated the toolbar to work with Firefox 5?  What&#8217;s the deal?</p>
<p><em><strong>Update</strong></em> (July 22, 2011): This kinda pisses me off. Apparently Google is dropping support for the Google Toolbar in Firefox 5+ (“Therefore, while Google Toolbar for Firefox works on versions up to and including Firefox 4 only, it will not be supported on Firefox 5 and future versions.”). I’m not just pissed that I’m losing a bunch of functionality I use every day, but now I have to hunt and peck to cobble together replacements for the tools I use every day. Thanks a lot Google.</p>
<p>Source: http://googletoolbarhelp.blogspot.com/2011/07/update-on-google-toolbar-for-firefox.html</p>
<p><em><strong>Update</strong></em> (October 7, 2011): Someone over at optimize-your-pc.org discovered a nice hack to get the toolbar working again in FF7! All it takes is two quick modifications to some files for the toolbar and you&#8217;re back in business. Worked for me in Windows 7 and XP. Check it out at <a href="http://www.optimize-your-pc.org/use-google-toolbar-on-firefox-6-and-7">http://www.optimize-your-pc.org/use-google-toolbar-on-firefox-6-and-7</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/07/07/hey-google-wheres-my-toolbar-for-firefox-5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Before/After jQuery Plugin 1.3 Released</title>
		<link>http://www.catchmyfame.com/2011/05/22/beforeafter-jquery-plugin-1-3-released/</link>
		<comments>http://www.catchmyfame.com/2011/05/22/beforeafter-jquery-plugin-1-3-released/#comments</comments>
		<pubDate>Sun, 22 May 2011 21:36:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=820</guid>
		<description><![CDATA[I’m happy to announce the release of Before/After 1.3! This new release features: Several new options. You can: Set the starting horizontal position of the draggable divider Set the text for the before/after links Set the cursor style Set the speed of animation when clicking an image Set the speed of animation when clicking a [...]]]></description>
			<content:encoded><![CDATA[<p>I’m happy to announce the release of Before/After 1.3!</p>
<p>This new release features:</p>
<ul>
<li>Several new options. You can:
<ul>
<li>Set the starting horizontal position of the draggable divider</li>
<li>Set the text for the before/after links</li>
<li>Set the cursor style</li>
<li>Set the speed of animation when clicking an image</li>
<li>Set the speed of animation when clicking a link</li>
<li>Set the color of the divider</li>
<li>onReady callback function</li>
</ul>
</li>
<li>jQuery and jQueryUI draggable are now bundled with the plugin for those that don’t want to, or can’t use, a CDN.</li>
<li>Tighter code (6.7 Kb uncompressed, 4.5 Kb compressed).</li>
<li>Compatible with jQuery 1.6.1</li>
</ul>
<p>Notes:</p>
<ul>
<li>The CSS classes for the span tags that wrapped the text links have been changed from “bflinks” to “balinks”.</li>
<li>The requirement to have each image nested within a div tag has been removed; however the plugin will still work if you use that structure.</li>
<li>The previous version of the plugin took the images and made them background-images within div because of issues with webkit browsers and jQuery at the time. Those issues no longer exist so the original functionality of using the images as-is has been restored.</li>
</ul>
<p>I&#8217;ve created a dedicated page for the plugin at <a href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/">http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/</a>. In the future this page will be updated to contain the latest information for this plugin.</p>
<p>Or if you just can&#8217;t wait, <a href="http://www.catchmyfame.com/jquery/beforeafter.zip">download version 1.3 here</a>.</p>
<p>I plan on adding a post in the upcoming days about how you can add a few lines of code to enable a simple &#8220;loading, please wait&#8221; feature if you&#8217;re using the plugin with large images that may not load quickly.</p>
<p>Finally, while this version of the plugin doesn&#8217;t have touchscreen support for mobile devices, I do plan on adding that feature in the future. jQuery&#8217;s touch library is still in alpha and seems a bit quirky, and other libraries also have their issues. I&#8217;d prefer to avoid libraries for such a small amount of functionality so that the size can be kept down, so feel free to post suggestions on how to best accomplish this.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/05/22/beforeafter-jquery-plugin-1-3-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thank You for Using the Before/After Plugin</title>
		<link>http://www.catchmyfame.com/2011/05/16/thank-you-for-using-the-beforeafter-plugin/</link>
		<comments>http://www.catchmyfame.com/2011/05/16/thank-you-for-using-the-beforeafter-plugin/#comments</comments>
		<pubDate>Mon, 16 May 2011 20:13:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=810</guid>
		<description><![CDATA[I just wanted to thank the New York Times, the Los Angeles Times, PBS, Expressen.se, Bild.de, and many more organizations for using the Before/After plugin. Your support helps continue develop of this plugin and other web applications.]]></description>
			<content:encoded><![CDATA[<p>I just wanted to thank the New York Times, the Los Angeles Times, PBS, Expressen.se, Bild.de, and many more organizations for using the<a title="jQuery Before/After Plugin 1.2 Now Available" href="http://www.catchmyfame.com/2010/10/20/jquery-beforeafter-plugin-1-2-now-available/"> Before/After plugin</a>. Your support helps continue develop of this plugin and other web applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/05/16/thank-you-for-using-the-beforeafter-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adjustable Columns with jQuery</title>
		<link>http://www.catchmyfame.com/2010/08/12/adjustable-columns-with-jquery/</link>
		<comments>http://www.catchmyfame.com/2010/08/12/adjustable-columns-with-jquery/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:10:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=649</guid>
		<description><![CDATA[View the demo here I’m currently working on a project that uses jQuery throughout the user interface to improve the user’s experience. In one section of the application there are three divs laid out next to each other horizontally as if they were three columns. The leftmost div contains a series of items to select [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://www.catchmyfame.com/jquery/adjustable_columns_with_jquery.html" target="_blank">View the demo here</a></h2>
<p>I’m currently working on a project that uses jQuery throughout the user interface to improve the user’s experience. In one section of the application there are three divs laid out next to each other horizontally as if they were three columns. The leftmost div contains a series of items to select from via check boxes. When you pick one (or more) items, the middle div is populated by a jQuery Ajax query and displays a list where the content is based on what was selected in the first (leftmost) group. Finally, you can click on an item in the middle div which will then bring up detailed information in the rightmost div.</p>
<p><img class="alignnone size-full wp-image-651" title="columns1" src="http://www.catchmyfame.com/wp-content/uploads/2010/08/columns1.png" alt="" width="430" height="175" /></p>
<p>Normally this wouldn’t be a problem, but in this case the issue is that the width of the columns needed to be dynamic. If we had made the column widths fixed, then whenever the data in any of the columns was wider than the containing div, a horizontal scrollbar would’ve popped up. While this wasn’t a showstopper, it’s wasn’t visually appealing. You might be thinking that using a table would be a good solution except for the fact that resizing table cells isn’t much easier than resizing multiple divs, plus we’re not displaying true tabular data. Another possible answer could lie in using frames, except for the fact that frames disappear in HTML5 and I haven’t used frames in over 10 years.<span id="more-649"></span></p>
<p>So back to our divs. To find a solution I realized that not only would I need the three main div containers, but I would also need two more divs to act as column separators. These two new divs should give me something to grab and drag since dragging the left, middle, and right container divs themselves wouldn’t look right.  OK, so now we have five divs laid out horizontally. Three for content and two to act as drag handles.</p>
<p><img class="alignnone size-full wp-image-652" title="columns2" src="http://www.catchmyfame.com/wp-content/uploads/2010/08/columns2.png" alt="" width="430" height="175" /></p>
<p>So we have our layout but the real brain work still needed to be done. How can I manage all the divs so that only the two &#8220;handles&#8221; were draggable AND the three content divs would respond to the movement of either handle? By using jQuery I could make the two handles draggable – that was easy. The problem now was how to get the content divs to react to the handles being moved. After <em>many</em> failed experiments, I determined how to properly arrange the divs so that dragging the handles not only properly resized the container divs, but the handle divs were prevented from overlapping each other.</p>
<p>During some of my initial experiments I would drag the handles and the neighboring content divs would be resized, but they ended up pushing my handles while they were being dragged making them move much farther than they should have. After positioning the handle divs absolutely that solved the ghost movements, but introduced another problem. With the handles positioned absolutely, they had been removed from the flow of the document so I couldn’t rely on their dimensions and other CSS attributes to “push” the other content divs. Now I had to calculate their position and use that information to resize the other div’s width. When dragging the left handle we would change the width of the left and center content divs. When dragging the right handle we would change the width of the center and right content divs. There wasn’t any need to change the left position, margin, or padding for any of the elements and this was a big relief.</p>
<p>Not to go into too much technical detail, but jQuery’s draggable interaction has a containment option which allows you to restrict the movement of draggable elements. This would be critical to prevent the handles from being dragged too far. The problem is that you either pass it an element, like the parent of a draggable element, the body of the page, or give it a set of coordinates. The problem with the coordinate system is that it’s relative to the document, not an element. Had we been able to specify the coordinates relative to an element rather than the document, this would’ve been much easier.  Since we had to use coordinates relative to the document we had to make our calculations relative to the document as well, which caused a conflict with webkit browsers when we wanted to center our columns. The problem with webkit browsers is that they don’t calculate the jQuery offset() function properly when you center something by using margin: 0 auto and you have a whole slew of “how am I ever gonna get this one to work?” problems to solve. Once I figure out that by solving the webkit centering issue I wouldn’t have to worry about the offset() issue it was smooth sailing.</p>
<p>Another issue involved the content divs themselves. Floating them didn’t work and absolute positioning didn’t either.  I began to dig into the CSS display property. Did you know that the display property can be:  block, inline-block, inline-table, list-item, run-in, table, table-caption, table-cell, table-column, table-column-group, table-footer-group, table-header-group, table-row, or table-row-group? Neither did I. As it turns out, inline-table did the trick. (Note: I later found out that inline-block also works just fine.)</p>
<p>The W3C says that the inline-table property is “a rectangular block that participates in an inline formatting context”. This basically means that you can have a block with a width, height, margins, etc. but it’s treated as an inline element instead of the usual block element. Hmmm. So far so good. Add that, width, and a little vertical-align:top to all the container divs and we’re looking good. The handle divs get positioned absolutely and get their left position set initially based on the container divs to their left (i.e. the first handle has a left position equal to the width of the first container div and the second handle has a left position equal to the width of the first two container divs plus the width of the first handle. That’s all the CSS you need, the rest is jQuery.</p>
<p>Since we can’t center the big div that contains everything and do our dragging because webkit browsers can’t calculate the correct jQuery offset, we center it manually (note that this isn’t necessary if you’re not going to center the whole shebang). Then we have to figure out the horizontal limits of our drag handles. We don’t want to have people dragging the left handle over the right handle and vice versa, plus we should also give the content divs a minimum width so that the content doesn’t become unreadable. Finally we calculate the containment area for each draggable handle once the opposite handle is finished being dragged. Phew.</p>
<p>Finally, this code is pretty compact and works in all browsers including IE8. It doesn’t work in IE7 or IE6 and that’s just fine with me. It also degrades well for those with JavaScript disabled. Check out the demo and feel free to play with the code. If you come up with a more elegant solution or use this in a project of your own feel free to share it.</p>
<h2><a href="http://www.catchmyfame.com/jquery/adjustable_columns_with_jquery.html" target="_blank">View the demo here</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2010/08/12/adjustable-columns-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Msnbc.com’s Weird Redesign</title>
		<link>http://www.catchmyfame.com/2010/06/30/msnbc-com%e2%80%99s-weird-redesign/</link>
		<comments>http://www.catchmyfame.com/2010/06/30/msnbc-com%e2%80%99s-weird-redesign/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 01:50:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=631</guid>
		<description><![CDATA[If you’re a regular visitor to msnbc.com you may or may not have noticed the recent changes to their website. At first it appears as if there were only minor cosmetic changes to the header of the page but upon closer inspection you’ll notice something else – a ridiculous choice of content placement. The first [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re a regular visitor to msnbc.com you may or may not have noticed the recent changes to their website. At first it appears as if there were only minor cosmetic changes to the header of the page but upon closer inspection you’ll notice something else – a ridiculous choice of content placement.</p>
<p>The first time you visit the page you see what appears to be a normal home page</p>
<p><a href="http://www.catchmyfame.com/wp-content/uploads/2010/06/msnbc1.jpg" rel="thumbnail"><img class="alignnone size-medium wp-image-632" title="msnbc1" src="http://www.catchmyfame.com/wp-content/uploads/2010/06/msnbc1-300x138.jpg" alt="" width="300" height="138" /></a></p>
<p>Notice that the vertical scroll isn&#8217;t at the top of the page? It’s almost imperceptible and in fact, I didn’t notice it for a week. Why does this happen? Scroll up the page and you’ll see that msnbc.com now has a large chunk of content sitting up above what appears to be the normal top of the page. It wasn’t until I saw a link where some of the old navigation used to be that said “Where’s my navigation? We’ve moved it to the top” that I noticed this big change.</p>
<p><a href="http://www.catchmyfame.com/wp-content/uploads/2010/06/msnbc2.jpg" rel="thumbnail"><img class="alignnone size-medium wp-image-634" title="msnbc2" src="http://www.catchmyfame.com/wp-content/uploads/2010/06/msnbc2-300x203.jpg" alt="" width="300" height="203" /></a></p>
<p>So I have to ask why would you redesign a page and place a large chunk of important content up above where the visitor will see when a page loads so that they have to scroll up to see it? This just seems completely counter intuitive to web navigation. Visit a news site and then scroll up to read the headlines? That&#8217;s like opening the New York Times and then finding that the top stores section was folded down behind the front page.</p>
<p>Msnbc.com explains this change by saying “We&#8217;ve moved the news menu to the top of story pages and made it easier to see what&#8217;s happening across the site. When you first get to a story, you&#8217;ll see sections and shows displayed across the top of the page. Below is the name of the section you&#8217;re in and a search box. Scroll up to see top headlines, slideshows, video and hot topics. Roll over a section name to see more from that section and click on a section name to go there.” Scroll. Roll. Click. Are they serious? Is it just me?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2010/06/30/msnbc-com%e2%80%99s-weird-redesign/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Infinite Carousel Updated (2.0.2)</title>
		<link>http://www.catchmyfame.com/2010/06/12/jquery-infinite-carousel-updated-2-0-2/</link>
		<comments>http://www.catchmyfame.com/2010/06/12/jquery-infinite-carousel-updated-2-0-2/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 14:08:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=621</guid>
		<description><![CDATA[Thanks to Sergio for finding a bug in the carousel where a certain sequence of clicks resulted in the play button being disabled, I&#8217;m happy to release version 2.0.2 which corrects the issue. Click here for the latest version or see our jQuery plugins page.]]></description>
			<content:encoded><![CDATA[<p>Thanks to Sergio for finding a bug in the carousel where a certain sequence of clicks resulted in the play button being disabled, I&#8217;m happy to release version 2.0.2 which corrects the issue. Click <a href="/jquery/jquery.infinitecarousel2.zip">here</a> for the latest version or see our <a href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/">jQuery plugins page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2010/06/12/jquery-infinite-carousel-updated-2-0-2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

