<?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; JavaScript/jQuery</title>
	<atom:link href="http://www.catchmyfame.com/category/js/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>Infinite Carousel Update</title>
		<link>http://www.catchmyfame.com/2012/02/02/infinite-carousel-update/</link>
		<comments>http://www.catchmyfame.com/2012/02/02/infinite-carousel-update/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 14:18:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=1000</guid>
		<description><![CDATA[A minor bug with the wait indicator image in Infinite Carousel 3 has been fixed. The path to the image was incorrect and has been fixed. Version 3.0.2 is now available for download.]]></description>
			<content:encoded><![CDATA[<p>A minor bug with the wait indicator image in Infinite Carousel 3 has been fixed. The path to the image was incorrect and has been fixed. Version 3.0.2 is now available for download.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2012/02/02/infinite-carousel-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Infinite Carousel 3 Updates with Demos and Own Page</title>
		<link>http://www.catchmyfame.com/2011/12/29/infinite-carousel-3-updates-with-demos-and-own-page/</link>
		<comments>http://www.catchmyfame.com/2011/12/29/infinite-carousel-3-updates-with-demos-and-own-page/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 00:04:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=990</guid>
		<description><![CDATA[I&#8217;ve created a page specifically for the latest version of the Infinite Carousel at http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/. All future updates will be found at this page. This page contains the zip file, demos, instructions and everything you&#8217;ll need to get the plugin running on your site.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a page specifically for the latest version of the <a href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/">Infinite Carousel</a> at <a href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/">http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/</a>. All future updates will be found at this page. This page contains the zip file, demos, instructions and everything you&#8217;ll need to get the plugin running on your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/12/29/infinite-carousel-3-updates-with-demos-and-own-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Infinite Carousel 3 &#8211; Now Available</title>
		<link>http://www.catchmyfame.com/2011/12/24/infinite-carousel-3-now-available/</link>
		<comments>http://www.catchmyfame.com/2011/12/24/infinite-carousel-3-now-available/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 20:13:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=964</guid>
		<description><![CDATA[Twas the night before Christmas, and all through the house&#8230; Ok, ok, I&#8217;ll spare the hackneyed rhymes and just present you with a completely new Infinite Carousel 3 for the holidays! Unfortunately since this is a ridiculously busy time of year, I haven&#8217;t had time to throw up any demos just yet. But I will. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Twas the night before Christmas, and all through the house&#8230;</strong></p>
<p>Ok, ok, I&#8217;ll spare the hackneyed rhymes and just present you with a completely new Infinite Carousel 3 for the holidays!</p>
<p>Unfortunately since this is a ridiculously busy time of year, I haven&#8217;t had time to throw up any demos just yet. But I will. In a few days. But in the meantime you can download the plugin and use it to your heart&#8217;s content. I did managed to cobble together some basic information about using the new version which I&#8217;m posting below.<span id="more-964"></span></p>
<h3>Download</h3>
<ul>
<li><strong><a title="jQuery Infinite Carousel Plugin" href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/">Infinite Carousel 3</a></strong></li>
</ul>
<h3>What&#8217;s New</h3>
<ul>
<li>Completely rewritten. Smoother, faster, tighter.</li>
<li>New options</li>
<li>Images can be linked</li>
<li>The carousel now accepts images and videos</li>
<li>New timer</li>
<li>New thumbnail options</li>
<li>Easier styling</li>
</ul>
<h3>Notes</h3>
<ul>
<li>Easing effects still require a separate jQuery easing plugin (I recommend http://gsgd.co.uk/sandbox/jquery/easing/), or adding easing code on your own.</li>
</ul>
<h3>Options</h3>
<ul>
<li>transitionSpeed – the time (in milliseconds) a transition from one item to another should take (default 800)</li>
<li>displayTime – the time (in milliseconds) an item should be displayed (default 6000)</li>
<li>displayProgressRing – a Boolean value that shows or hides the progress ring in the upper right hand of the carousel (default true)</li>
<li>progressRingColorOpacity – the color and opacity (in RGBa format) of the progress ring (default &#8217;0,0,0,.5&#8242;)</li>
<li>progressRingBackgroundOn &#8211; a Boolean value that shows or hides the progress ring background ring (default true</li>
<li>progressRingBackgroundColorOpacity &#8211; the color and opacity (in RGBa format) of the progress ring background ring (default &#8217;255,255,255,.5&#8242;)</li>
<li>thumbnailType – the format of the item thumbnails (default &#8216;none&#8217;. Possible values are: ‘buttons’, ‘images’, ‘numbers’, ‘count’, or ‘none’)</li>
<li>easeLeft – the easing method when the carousel moves to the left (default &#8216;linear&#8217;. To use values other than linear, either add an easing plugin or add easing code of your own)</li>
<li>easeRight &#8211; the easing method when the carousel moves to the right (default &#8216;linear&#8217;. To use values other than linear, either add an easing plugin or add easing code of your own)</li>
<li>imagePath – the path to the carousel’s navigation and playback control images (default &#8216;/js/infinitecarousel/images/&#8217;)</li>
<li>inView – the number of items to be viewable at once (default 1)</li>
<li>margin – the amount of margin to add around items (default 0)</li>
<li>advance – the number of items to advance when a user clicks the left or right navigation buttons or the carousel is on autopilot (default 1)</li>
<li>customClass – a name to be assigned to the carousel (or the carousel’s wrapper) that can be used for styling or scripting. The name will be prepended with “ic_” (default null)</li>
<li>showControls – a Boolean value that shows or hides the play/pause controls (default true)</li>
<li>autoHideCaptions – a Boolean values that hides captions between transitions ( default false)</li>
<li>autoPilot – a Boolean value that moves the carousel automatically when the page loads (default false)</li>
<li>prevNextInternal – a Boolean value that places the left/right navigation arrows inside or outside the carousel (default true)</li>
<li>internalThumbnails – a Boolean values that determines whether the thumbnails are placed inside or below the carousel (default false)</li>
<li>enableKeyboardNav – a Boolean value that enables or disables keyboard navigation. The left and right keys mimic the left and right arrows of the carousel, p pauses playback and s starts playback (default true).</li>
<li>onSlideStart &#8211; default function(){},</li>
<li>onSlideEnd &#8211; default function(){},</li>
<li>onPauseClick &#8211; default function(){},</li>
<li>onPlayClick &#8211; default function(){}</li>
</ul>
<h3>HTML</h3>
<ul>
<li>An unordered list should contain your items (images, videos, or a mix).</li>
<li>All items in the list must have the same dimensions which must be set</li>
<li>Images can be wrapped with links</li>
<li>Captions must be contained in paragraph tags and come after the image</li>
<li>User CSS now controls the look of the thumbnails</li>
<li>Video can have their own thumbnails by adding a longdesc attribute to them.</li>
</ul>
<pre><strong>Ex</strong>:
    &lt;ul id="carousel"&gt;
        &lt;li&gt;&lt;img width="200" height="133" alt="" src="p1.png" /&gt;&lt;p&gt;This is &lt;strong&gt;a caption&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com"&gt;&lt;img width="200" height="133" alt="" src="p2.png" /&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com"&gt;&lt;img width="200" height="133" alt="" src="p3.png" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;</pre>
<h3>Instantiating</h3>
<ul>
<li>$(&#8216;#carousel&#8217;).infiniteCarousel({});</li>
</ul>
<h3>CSS Classes</h3>
<ul>
<li>.ic_caption &#8211; styles the captions</li>
<li>.ic_button – styles thumbnails</li>
<li>.ic_active – styles the active thumbnail containers</li>
<li>.ic_thumbnails – styles the div that holds the thumbnails</li>
</ul>
<p>&nbsp;</p>
<pre>	** what's new:
		* completely rewritten. smoother, faster, tighter.
		* new options
		* captions
		* links
		* images or videos
		* new timer
		* new thumbnail options
		* easier styling</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/12/24/infinite-carousel-3-now-available/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Looks Like I Have Some Work To Do</title>
		<link>http://www.catchmyfame.com/2011/12/08/looks-like-i-have-some-work-to-do/</link>
		<comments>http://www.catchmyfame.com/2011/12/08/looks-like-i-have-some-work-to-do/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 21:55:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=953</guid>
		<description><![CDATA[The jQuery team just posted news about changes to their plugin repository to their blog. This really only impact jQuery plugin developers (like me) and not end users so most of you don&#8217;t need to worry about this. However if you&#8217;re like me, you have some changes to make. In a nutshell the blog post [...]]]></description>
			<content:encoded><![CDATA[<p>The jQuery team just posted news about changes to their plugin repository to <a href="http://blog.jquery.com/2011/12/08/what-is-happening-to-the-jquery-plugins-site/">their blog</a>. This really only impact jQuery plugin developers (like me) and not end users so most of you don&#8217;t need to worry about this. However if you&#8217;re like me, you have some changes to make. In a nutshell the blog post says:</p>
<ul>
<li>We’d been planning on replacing the original, spam-ridden plugin site for quite some time</li>
<li>In the process of deleting on the spam, all the plugins were deleted and we didn’t have a recent backup</li>
<li>Instead of burning cycles keeping the old site on life support, we decided to make a clean break and kick development on the new site into high gear.</li>
<li>The new site is powered by GitHub and a <a href="https://github.com/jquery/plugins.jquery.com/blob/master/docs/package.md">package manifest for plugins</a></li>
<li>Plugins from the old site were never going to be automatically imported into the new one.</li>
<li>The repo is at <a href="http://github.com/jquery/plugins.jquery.com">github.com/jquery/plugins.jquery.com</a></li>
<li>We are very sorry, but also very excited!</li>
</ul>
<p>So it looks like I&#8217;ll have to get everything moved over to github and make some updates to the plugin packages as well. In the meantime you can continue to download the plugins from this site. One of which is currently being completely re-written :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/12/08/looks-like-i-have-some-work-to-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>NASA Using Before/After</title>
		<link>http://www.catchmyfame.com/2011/08/22/nasa-using-beforeafter/</link>
		<comments>http://www.catchmyfame.com/2011/08/22/nasa-using-beforeafter/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 19:12:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=892</guid>
		<description><![CDATA[It&#8217;s always gratifying to see your work being used. Nothing can be more frustrating than spending hours, day, or weeks working on a project you believe in only to see it languish and fade away into obscurity. Without a doubt the Before/After plugin is this site&#8217;s most popular plugin. It&#8217;s been described as &#8216;remarkable&#8217;, &#8216;powerful&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always gratifying to see your work being used. Nothing can be more frustrating than spending hours, day, or weeks working on a project you believe in only to see it languish and fade away into obscurity. Without a doubt the Before/After plugin is this site&#8217;s most popular plugin. It&#8217;s been described as &#8216;remarkable&#8217;, &#8216;powerful&#8217;, &#8216;genius&#8217;, &#8216;cool&#8217;, &#8216;amazing&#8217;, and used in a variety of ways to show the dramatic impact of topics like natural disasters, medical procedures, remodeling, and much more. I&#8217;d like to add NASA as one of our newest Before/After plugin users. Head on over to <a href="http://earthobservatory.nasa.gov/IOTD/view.php?id=51678" target="_blank">NASA&#8217;s Earth Observatory</a> and check out some of their amazing imagery including some cool before and after pictures which now use the Before/After plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/08/22/nasa-using-beforeafter/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>A jQuery + Canvas Scratch Off</title>
		<link>http://www.catchmyfame.com/2011/06/28/a-jquery-canvas-scratch-off/</link>
		<comments>http://www.catchmyfame.com/2011/06/28/a-jquery-canvas-scratch-off/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 02:30:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript/jQuery]]></category>

		<guid isPermaLink="false">http://www.catchmyfame.com/?p=854</guid>
		<description><![CDATA[I&#8217;ve worked on Flash scratch off card applications for many years, and the other day I wondered if it was possible to get the same effect without Flash. I&#8217;m a huge jQuery fan &#8212; it never fails to make my JavaScript coding easier, but I know that jQuery doesn&#8217;t have the ability alone to simulate [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve worked on Flash scratch off card applications for many  years, and the other day I wondered if it was possible to get the same effect  without Flash. I&#8217;m a huge jQuery fan &#8212; it never fails to make my JavaScript  coding easier, but I know that jQuery doesn&#8217;t have the ability alone to simulate  such an effect. This lead me to the red-headed stepchild element in the HTML  universe, &lt;canvas&gt;. The canvas element has always been one of those tags that  I&#8217;ve known about but never really gotten into, mainly because there&#8217;s so much  that it can do that it&#8217;s more than just your average HTML element. In a  nutshell, the canvas element allows you to draw using JavaScript. Perfect. Now  all I had to do was learn canvas.<span id="more-854"></span></p>
<p>Let me say that canvas support is better than ever with all major browsers  now supporting it. In the past this was always a weak point for canvas as IE8  had no canvas support (without hacks), so the case for using canvas was limited.  Until now. Unfortunately the documentation for canvas is a little fragmented and  getting a good grip on all the nuances and features can be a bit frustrating.  But this article isn&#8217;t about me teaching you canvas, it&#8217;s about how canvas can  be used to build a scratch off card without having to use a lick of Flash.</p>
<p>What shocked me the most was how basic the final code I came up with was that  accomplished the effect. The Actionscript for a Flash scratch off is no walk in  the park, but the canvas version is very neat and clean. In fact, the function  that does the heavy lifting is just six lines long. Six lines! And the weird  part there is that none of the savings happens to come from jQuery. jQuery does  show its strength in the rest of my code by handing the various mouse movements  and DOM manipulations, in a total of about 45 lines of code. Awesome.</p>
<p>So I present to you a jQuery/Canvas scratch off that requires no Flash. Move  your mouse over the scratch card and you&#8217;ll see a coin follow your mouse. Click  and drag and you&#8217;ll soon be on your way to scratching to reveal the prize below  the top layer. Voilà!</p>
<div class="iframe-wrapper">
  <iframe src="/jquery/canvas/scratch-demo.html" scrolling="no" frameborder="0" style="height:230px;width:305px;">Please upgrade your browser</iframe>
</div>
<h3>How it Works</h3>
<p>Instead of a line by line breakdown of the code I&#8217;m going to give an overview  of the entire process. We start by loading the images we&#8217;ll be using via  JavaScript. Then we place a &lt;canvas&gt; tag on our page with the width and height  set to match the dimensions of the images we&#8217;ll be using for our top and bottom  layers (the top layer refers to the layer that would be scratched off on a real  scratch off card and the bottom layer is what would be revealed). When the page  loads, we begin the bulk of our scripting. We create and append a second  &#8220;overlay&#8221; canvas element on top of the original canvas to hold our coin image.  We tie listeners for the mousedown, mouseup, and mousemove events to this  overlay canvas so that our coin image follows the mouse whenever it moves and  that the scratch off effect is triggered only when the mousedown event occurs.</p>
<p>The mousedown event is where the scratch effect takes place. This bit of code  comes from a trick I borrowed from my Flash scratch off creation days. While it  looks like you&#8217;re removing parts of the &#8220;top&#8221; layer to reveal the &#8220;bottom&#8221;  layer, you&#8217;re actually drawing parts of the bottom layer on top of the top layer  using the canvas element&#8217;s clip() method. Basically we&#8217;re drawing an arc  (circle) and then clipping it to unmask, or reveal, part of the bottom layer  image which is then drawn over the top image on our main canvas. In other words,  we first draw our circle shape and then combine that with the bottom image so  that only that part of the bottom image is used. We then apply that clipped  image and draw it onto our main canvas, thus creating the scratch off effect. We  repeatedly save and restore our clipping path to build it up as we continually  click and drag. Did I mention that the effect takes just six lines of code?!</p>
<p>Unfortunately neither the canvas element nor jQuery have any built-in  collision detection like Flash does. If either one did then this would have  allowed me to find out how much scratching someone had done and complete the  process for them when they had scratched enough. For example, if they had  scratched away 80% of the top layer (actually drawing 80% of the bottom layer  but let&#8217;s not split hairs) then we could remove the rest of the little pieces  automatically. Not a necessity by any means, but it would have been a nice  touch. If anyone knows of an easy way to do this that doesn&#8217;t add tons of code  or eat memory then let me know.</p>
<p>So there you have it. All you need are three images (top layer, bottom layer,  and coin) and this code. You could conceivable get rid of the overlay canvas and  coin, however I&#8217;ve found it a little more user-friendly to have the coin in  there so that the user doesn&#8217;t just see the mouse cursor poking holes in the  image. You could also use PHP to dynamically create the bottom image so that it  randomly changed.</p>
<h3>License</h3>
<p>This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike  3.0 Unported (CC BY-NC-SA 3.0) (http://creativecommons.org/licenses/by-nc-sa/3.0/).  For commercial use, please email admin@catchmyfame.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.catchmyfame.com/2011/06/28/a-jquery-canvas-scratch-off/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

