<?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>workblog &#187; JavaScript</title>
	<atom:link href="http://iandunn.name/workblog/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://iandunn.name/workblog</link>
	<description></description>
	<lastBuildDate>Wed, 25 Aug 2010 22:23:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lightbox Clones</title>
		<link>http://iandunn.name/workblog/lightbox-clones/</link>
		<comments>http://iandunn.name/workblog/lightbox-clones/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 18:26:16 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=204</guid>
		<description><![CDATA[The Lightbox Clones Matrix is a list of scripts that do inline popups, ala Lightbox. You can filter by JavaScript frameworks and features.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://planetozh.com/projects/lightbox-clones/">The Lightbox Clones Matrix</a> is a list of scripts that do inline popups, ala Lightbox. You can filter by JavaScript frameworks and features.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/workblog/lightbox-clones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preloading Images</title>
		<link>http://iandunn.name/workblog/preloading-images/</link>
		<comments>http://iandunn.name/workblog/preloading-images/#comments</comments>
		<pubDate>Fri, 29 May 2009 18:10:00 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=100</guid>
		<description><![CDATA[I&#8217;ve been looking for a good way to preload images for rollovers, but it seems like a lot of the common methods have problems.

There are reliability issues using a JavaScript Image object or document.write()
Some browsers won&#8217;t load a display:none containing element

So far the best way I&#8217;ve found is Perishable Press&#8217; Better Image Preloading without JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a good way to preload images for rollovers, but it seems like a lot of the common methods have problems.</p>
<ul>
<li>There are reliability issues using a JavaScript Image object or document.write()</li>
<li>Some browsers won&#8217;t load a display:none containing element</li>
</ul>
<p>So far the best way I&#8217;ve found is Perishable Press&#8217; <a href="http://perishablepress.com/press/2008/04/15/pure-css-better-image-preloading-without-javascript/">Better Image Preloading without JavaScript</a> method. You can set the hover images as the background on the regular image, and then position it outside of the image, so it doesn&#8217;t show up:</p>
<pre name="code" class="css">

#foo1 {background: url(foo1-hover.png) no-repeat -500px -500px ;}
#foo2 {background: url(foo2-hover.png) no-repeat -500px -500px ;}
#foo3 {background: url(foo3-hover.png) no-repeat -500px -500px ;}
</pre>
<p>The problem I have with this one, though, is that the hover images will be loaded with the rest of the page, making it slower. I don&#8217;t think they should be loaded until after the rest of the page has finished loading. So, I used SitePoint&#8217;s <a href="http://www.sitepoint.com/blogs/2004/05/26/closures-and-executing-javascript-on-page-load/">addLoadEvent()</a> to assign the background images after the page loads:</p>
<pre name="code" class="javascript">

document.getElementById(&quot;foo1&quot;).style.background = &quot;url(foo1-hover.png) no-repeat -500px -500px&quot;;
document.getElementById(&quot;foo2&quot;).style.background = &quot;url(foo2-hover.png) no-repeat -500px -500px&quot;;
document.getElementById(&quot;foo3&quot;).style.background = &quot;url(foo3-hover.png) no-repeat -500px -500px&quot;;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/workblog/preloading-images/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Passing Arguments to an Event Handler</title>
		<link>http://iandunn.name/workblog/passing-arguments-to-an-event-handler/</link>
		<comments>http://iandunn.name/workblog/passing-arguments-to-an-event-handler/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:34:54 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=37</guid>
		<description><![CDATA[Mark Wilton-Jones has a good overview of the most common methods passing arguments to an event handler in JavaScript. This page has a function (addevent2()) that worked for me.
]]></description>
			<content:encoded><![CDATA[<p>Mark Wilton-Jones has a good overview of the most common methods <a href="http://www.howtocreate.co.uk/referencedvariables.html">passing arguments to an event handler</a> in JavaScript. <a href="http://www.fullposter.com/snippets.php?snippet=63">This page</a> has a function (addevent2()) that worked for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/workblog/passing-arguments-to-an-event-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mouseenter, mouseleave Events for non-IE Browsers</title>
		<link>http://iandunn.name/workblog/15/</link>
		<comments>http://iandunn.name/workblog/15/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 18:16:46 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=15</guid>
		<description><![CDATA[Stephen Stchur has written a script to mimic IE&#8217;s proprietary mouseenter and mouseleave Javascript events for non-IE browsers. This is useful when you have one element (B) laying on top of another element (A), and you want to do a mouseover/mouseout on A without the mouseout firing when you hover on B. Quirksmode has articles [...]]]></description>
			<content:encoded><![CDATA[<p>Stephen Stchur has written a script to <a href="http://blog.stchur.com/2007/03/15/mouseenter-and-mouseleave-events-for-firefox-and-other-non-ie-browsers/">mimic IE&#8217;s proprietary mouseenter and mouseleave Javascript events for non-IE browsers</a>. This is useful when you have one element (B) laying on top of another element (A), and you want to do a mouseover/mouseout on A without the mouseout firing when you hover on B. Quirksmode has articles on <a href="http://www.quirksmode.org/js/events_mouse.html">JavaScript mouse events</a> and <a href="http://www.quirksmode.org/js/events_order.html">event bubbling</a> that give good background information.</p>
<p><strong>Update:</strong> MooTools has <a href="http://demos.mootools.net/Mouseenter">mouseenter/mouseleave</a> built-in.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/workblog/15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
