<?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>live</title>
	<atom:link href="http://spuntinu.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://spuntinu.net</link>
	<description></description>
	<lastBuildDate>Sat, 21 Aug 2010 01:17:17 +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>AP Tries Its Hardest To Tie Ra&#8230;</title>
		<link>http://spuntinu.net/ap-tries-its-hardest-to-tie-ra/</link>
		<comments>http://spuntinu.net/ap-tries-its-hardest-to-tie-ra/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 01:17:17 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/ap-tries-its-hardest-to-tie-ra/</guid>
		<description><![CDATA[AP Tries Its Hardest To Tie Rand Paul To Porn Industry http://t.co/5eaiTnr via @techcrunch
]]></description>
			<content:encoded><![CDATA[<p>AP Tries Its Hardest To Tie Rand Paul To Porn Industry <a href="http://t.co/5eaiTnr" rel="nofollow">http://t.co/5eaiTnr</a> via @<a href="http://twitter.com/techcrunch" class="aktt_username">techcrunch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/ap-tries-its-hardest-to-tie-ra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>L&#8217;écrivain américain Ray Bra&#8230;</title>
		<link>http://spuntinu.net/lecrivain-americain-ray-bra/</link>
		<comments>http://spuntinu.net/lecrivain-americain-ray-bra/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 19:16:44 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/lecrivain-americain-ray-bra/</guid>
		<description><![CDATA[L&#8217;écrivain américain Ray Bradbury appelle les Etats-Unis à &#8220;la révolution&#8221; http://icio.us/emlz3m
]]></description>
			<content:encoded><![CDATA[<p>L&#8217;écrivain américain Ray Bradbury appelle les Etats-Unis à &#8220;la révolution&#8221; <a href="http://icio.us/emlz3m" rel="nofollow">http://icio.us/emlz3m</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/lecrivain-americain-ray-bra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insert a delay on large Drop-Down Menu with Prototype</title>
		<link>http://spuntinu.net/insert-a-delay-on-large-drop-down-menu-with-prototype/</link>
		<comments>http://spuntinu.net/insert-a-delay-on-large-drop-down-menu-with-prototype/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 17:42:25 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spuntinu.net/?p=2185</guid>
		<description><![CDATA[Large horizontal drop-down menus are quite popular these days, especially in e-commerce websites. However, they can cause ergonomic design troubles by launching on unintentional mouseovers. Which could be very irritating.
Fixing this problem by implementing a mouseover delay on the trigger (usually tabs of a menu) is therefore well-recommended.
For starters, using pure CSS2 solution with classic [...]]]></description>
			<content:encoded><![CDATA[<p>Large horizontal <a href="http://www.smashingmagazine.com/2009/03/24/designing-drop-down-menus-examples-and-best-practices/">drop-down menus</a> are quite popular these days, especially in e-commerce websites. However, they can cause ergonomic design troubles by launching on unintentional mouseovers. Which could be very irritating.</p>
<p>Fixing this problem by implementing a mouseover delay on the trigger (usually tabs of a menu) is therefore well-recommended.</p>
<p>For starters, using pure CSS2 solution with classic pseudo-class <code>:hover</code> is not in our situation a good solution, as you will have difficulties to put a delay on these events. Additionally, this pseudo-class isn&#8217;t supported on IE6. You would then have to find a hack in order to make <em>:hover</em> effective for IE6&#8230; yada yada.</p>
<p>CSS3 is coming out with a nice <code><a href="http://www.w3.org/TR/css3-transitions/#the-transition-delay-property-">transition-delay</a></code> property. I didn&#8217;t test it. Of course we all know that CSS3 is not by far yet the common standard. FYI, IE9 won&#8217;t be supported on Windows XP, and that&#8217;s not very helpful, to say the least.</p>
<p>You therefore have to use JavaScript to fix your little problem.</p>
<p>First, you can use <em>jQuery</em>, which comes with an excellent plugin, <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent</a>. Highly customizable, it&#8217;ll do everything you ask for.</p>
<p>If your website is powered by <em>Prototype</em>, you might not want to install <em>jQuery</em> only to fix this issue.<br />
So is here below a bunch of code which, with a little customization depending of your HTML structure, can help.</p>
<p><em>Prototype 1.6.1</em> supports <em>mouseenter/mouseleave</em> events, and CSS <em>nth-child</em> pseudo-class. I&#8217;ll use them.</p>
<p>HTML layout example:</p>
<pre class="brush: html">
&lt;ul id=&quot;menu&quot;&gt;
	&lt;li&gt;&lt;span&gt;Tab 1&lt;/span&gt;
		&lt;ul&gt;&lt;li&gt;Sub menu 1&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;Tab 2&lt;/span&gt;
		&lt;ul&gt;&lt;li&gt;Sub menu 2&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;Tab 3&lt;/span&gt;
		&lt;ul&gt;&lt;li&gt;Sub menu 3&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;span&gt;Tab 4&lt;/span&gt;
		&lt;ul&gt;&lt;li&gt;Sub menu 4&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Now, JavaScript.<br />
Set the lenght of the delay in the <em>menutabdelay</em> variable.</p>
<pre class="brush: js">

var menutabdelay = 500;

function visible(menutabnumber){
	$$(&#039;ul#menu &gt; li:nth-child(&#039;+menutabnumber+&#039;) &gt; ul&#039;).each(function(element){
		$(element).setStyle(&#039;visibility: visible;&#039;);
	});
}

function showsubmenu(element, menutabnumber){

	Event.observe(element, &#039;mouseenter&#039;, function(){
		timedelay = setTimeout(function(){visible(menutabnumber)}, menutabdelay);
	});

	Event.observe(element, &#039;mouseleave&#039;, function(){
		clearTimeout(timedelay);
		$$(&#039;ul#menu &gt; li &gt; ul&#039;).each(function(element){
			$(element).setStyle(&#039;visibility: hidden;&#039;);
		});
	});

}

function showsubmenutrigger() {
	var tabs = $$(&#039;ul#menu &gt; li&#039;);
	for(numberoftabs=1; numberoftabs&lt;=tabs.length; numberoftabs++){
		$$(&#039;ul#menu &gt; li:nth-child(&#039;+numberoftabs+&#039;)&#039;).each(function(element){
			var menutabnumber = numberoftabs;
			showsubmenu(element, menutabnumber);
		});
	}
}

Event.observe(window, &#039;load&#039;, showsubmenutrigger);
</pre>
<p><a href="http://spuntinu.net/wp-content/uploads/menu-delay/delay-big-menu.html" target="_blank">View demo</a></p>
<p>If you use a <em>Prototype</em> version prior to 1.6.1, these versions don&#8217;t support <em>mouseenter/mouseleave</em> events, so you have <a href="http://sandbox.kendsnyder.com/mouseenter.html">some fix to apply</a>.<br />
For information, <em>mouseenter/mouseleave</em> events are naturally supported by IE <a href="http://www.quirksmode.org/dom/events/mouseover.html">but not by other browsers</a>.<br />
You could ask, why don&#8217;t you use <em>mouseover/mouseout</em> events, supported by all browsers. My answer would be, it&#8217;s impossible because these events <em>naturally bubble</em> inside the element, and it&#8217;s big problem here because of the delay.</p>
<p>Long story short, see how to implement the fix below:</p>
<pre class="brush: js">
Element.addMethods({
    onmouseenter: function(element,observer) {
        element = $(element);
        element.observe(&#039;mouseover&#039;,function(evt,currentTarget) {
            var relatedTarget = $(evt.relatedTarget || evt.fromElement);
            if( relatedTarget!=currentTarget &amp;&amp; relatedTarget.childOf(currentTarget)==false ) {
                observer();
            }
        }.bindAsEventListener({},element));
        return element;
    },
    onmouseleave: function(element,observer) {
        element = $(element);
        element.observe(&#039;mouseout&#039;,function(evt,currentTarget) {
            var relatedTarget = $(evt.relatedTarget || evt.toElement);
            if( relatedTarget!=currentTarget &amp;&amp; relatedTarget.childOf(currentTarget)==false ) {
                observer();
            }
        }.bindAsEventListener({},element));
        return element;
    }
});

var menutabdelay = 500;

function visible(menutabnumber){
	$$(&#039;ul#menu &gt; li:nth-child(&#039;+menutabnumber+&#039;) &gt; ul&#039;).each(function(element){
		$(element).setStyle(&#039;visibility: visible;&#039;);
	});
}

function showsubmenu(element, menutabnumber){

	Event.observe(element, &#039;mouseenter&#039;, function(){
		timedelayIE = setTimeout(function(){visible(menutabnumber)}, menutabdelay);
	});

	Element.onmouseenter(element,function(){ // No IE
		timedelay = setTimeout(function(){visible(menutabnumber)}, menutabdelay);
	});

	Event.observe(element, &#039;mouseleave&#039;, function(){
		clearTimeout(timedelayIE);
		$$(&#039;ul#menu &gt; li &gt; ul&#039;).each(function(element){
			$(element).setStyle(&#039;visibility: hidden;&#039;);
		});
	});

	Element.onmouseleave(element,function(){ // No IE
		clearTimeout(timedelay);
		$$(&#039;ul#menu &gt; li &gt; ul&#039;).each(function(element){
			$(element).setStyle(&#039;visibility: hidden;&#039;);
		});
	});

}

function showsubmenutrigger() {
	var tabs = $$(&#039;ul#menu &gt; li&#039;);
	for(numberoftabs=1; numberoftabs&lt;=tabs.length; numberoftabs++){
		$$(&#039;ul#menu &gt; li:nth-child(&#039;+numberoftabs+&#039;)&#039;).each(function(element){
			var menutabnumber = numberoftabs;
			showsubmenu(element, menutabnumber);
		});
	}
}

Event.observe(window, &#039;load&#039;, showsubmenutrigger);
</pre>
<p><a href="http://spuntinu.net/wp-content/uploads/menu-delay/delay-big-menu-old.html" target="_blank">View demo (Prototype 1.6.0.3)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/insert-a-delay-on-large-drop-down-menu-with-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chaque semaine je découvre un&#8230;</title>
		<link>http://spuntinu.net/chaque-semaine-je-decouvre-un/</link>
		<comments>http://spuntinu.net/chaque-semaine-je-decouvre-un/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 12:01:08 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/chaque-semaine-je-decouvre-un/</guid>
		<description><![CDATA[Chaque semaine je découvre un album des Rolling Stones, et chaque semaine c&#8217;est la claque.
]]></description>
			<content:encoded><![CDATA[<p>Chaque semaine je découvre un album des Rolling Stones, et chaque semaine c&#8217;est la claque.</p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/chaque-semaine-je-decouvre-un/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La France c&#8217;est vraiment la pe&#8230;</title>
		<link>http://spuntinu.net/la-france-cest-vraiment-la-pe/</link>
		<comments>http://spuntinu.net/la-france-cest-vraiment-la-pe/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 12:45:54 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/la-france-cest-vraiment-la-pe/</guid>
		<description><![CDATA[La France c&#8217;est vraiment la petite Corée du Nord http://bit.ly/aA6iZ5
]]></description>
			<content:encoded><![CDATA[<p>La France c&#8217;est vraiment la petite Corée du Nord <a href="http://bit.ly/aA6iZ5" rel="nofollow">http://bit.ly/aA6iZ5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/la-france-cest-vraiment-la-pe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE 9 won&#8217;t be supported on XP&#8230;.</title>
		<link>http://spuntinu.net/ie-9-wont-be-supported-on-xp/</link>
		<comments>http://spuntinu.net/ie-9-wont-be-supported-on-xp/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 09:40:37 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/ie-9-wont-be-supported-on-xp/</guid>
		<description><![CDATA[IE 9 won&#8217;t be supported on XP. Me devastated.
]]></description>
			<content:encoded><![CDATA[<p>IE 9 won&#8217;t be supported on XP. Me devastated.</p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/ie-9-wont-be-supported-on-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Woah, New WRC website is excel&#8230;</title>
		<link>http://spuntinu.net/woah-new-wrc-website-is-excel/</link>
		<comments>http://spuntinu.net/woah-new-wrc-website-is-excel/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 18:34:43 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/woah-new-wrc-website-is-excel/</guid>
		<description><![CDATA[Woah, New WRC website is excellent ! http://wrc.com @OfficialWRC
]]></description>
			<content:encoded><![CDATA[<p>Woah, New WRC website is excellent ! <a href="http://wrc.com" rel="nofollow">http://wrc.com</a> @<a href="http://twitter.com/OfficialWRC" class="aktt_username">OfficialWRC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/woah-new-wrc-website-is-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flipboard for iPad: So revolut&#8230;</title>
		<link>http://spuntinu.net/flipboard-for-ipad-so-revolut/</link>
		<comments>http://spuntinu.net/flipboard-for-ipad-so-revolut/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 20:05:28 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/flipboard-for-ipad-so-revolut/</guid>
		<description><![CDATA[Flipboard for iPad: So revolutionary to read Twitter. Those who don&#8217;t see any interest in Twitter should try it&#8230; http://bit.ly/c32aGd
]]></description>
			<content:encoded><![CDATA[<p>Flipboard for iPad: So revolutionary to read Twitter. Those who don&#8217;t see any interest in Twitter should try it&#8230; <a href="http://bit.ly/c32aGd" rel="nofollow">http://bit.ly/c32aGd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/flipboard-for-ipad-so-revolut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pas top le nouveau site de la &#8230;</title>
		<link>http://spuntinu.net/pas-top-le-nouveau-site-de-la/</link>
		<comments>http://spuntinu.net/pas-top-le-nouveau-site-de-la/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:56:41 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/pas-top-le-nouveau-site-de-la/</guid>
		<description><![CDATA[Pas top le nouveau site de la Frônce : http://www.france.fr
]]></description>
			<content:encoded><![CDATA[<p>Pas top le nouveau site de la Frônce : <a href="http://www.france.fr" rel="nofollow">http://www.france.fr</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/pas-top-le-nouveau-site-de-la/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Required reading for web devel&#8230;</title>
		<link>http://spuntinu.net/required-reading-for-web-devel/</link>
		<comments>http://spuntinu.net/required-reading-for-web-devel/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 20:13:39 +0000</pubDate>
		<dc:creator>Jb</dc:creator>
				<category><![CDATA[twit]]></category>

		<guid isPermaLink="false">http://spuntinu.net/required-reading-for-web-devel/</guid>
		<description><![CDATA[Required reading for web developers: The Fountainhead by Ayn Rand http://icio.us/e54stf
]]></description>
			<content:encoded><![CDATA[<p>Required reading for web developers: The Fountainhead by Ayn Rand <a href="http://icio.us/e54stf" rel="nofollow">http://icio.us/e54stf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spuntinu.net/required-reading-for-web-devel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
