<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Using setTimeout to Delay Showing Event-Delegation Tooltips</title>
	<atom:link href="http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-83736</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Sun, 29 May 2011 15:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-83736</guid>
		<description>You &lt;em&gt;could&lt;/em&gt; use &lt;code&gt;.delay()&lt;/code&gt;, but I don&#039;t think it would make things any simpler in this case. The &lt;code&gt;.delay()&lt;/code&gt; method just uses a setTimeout to delay execution of the next item in a particular queue. It uses the &quot;fx&quot; queue by default, which allows us to do something very simple and clean with animations like &lt;code&gt;$(&#039;div.somediv&#039;).fadeIn().delay(4000).fadeOut()&lt;/code&gt;, but in this case you&#039;d need to use a custom queue name and then follow the delay with the .queue() method using the function as a callback. It gets a little tricky.

To avoid closing the tooltip when the user puts the mouse within the tooltip, you&#039;d first need to modify line 8 to something like:
&lt;code&gt; if (!$link.length &amp;&amp; !$(event.target).closest(&#039;#live-tip&#039;).length ) { return; }&lt;/code&gt;
Then, when you check for &lt;code&gt;event.type == &#039;mouseout&#039;&lt;/code&gt;, you&#039;d also need to make sure that &lt;code&gt;event.relatedTarget&lt;/code&gt; isn&#039;t the link or the tooltip before closing the tooltip.

Hope that helps to point you in the right direction.</description>
		<content:encoded><![CDATA[<p>You <em>could</em> use <code>.delay()</code>, but I don&#8217;t think it would make things any simpler in this case. The <code>.delay()</code> method just uses a setTimeout to delay execution of the next item in a particular queue. It uses the &#8220;fx&#8221; queue by default, which allows us to do something very simple and clean with animations like <code>$('div.somediv').fadeIn().delay(4000).fadeOut()</code>, but in this case you&#8217;d need to use a custom queue name and then follow the delay with the .queue() method using the function as a callback. It gets a little tricky.</p>
<p>To avoid closing the tooltip when the user puts the mouse within the tooltip, you&#8217;d first need to modify line 8 to something like:<br />
<code> if (!$link.length &#038;&#038; !$(event.target).closest('#live-tip').length ) { return; }</code><br />
Then, when you check for <code>event.type == 'mouseout'</code>, you&#8217;d also need to make sure that <code>event.relatedTarget</code> isn&#8217;t the link or the tooltip before closing the tooltip.</p>
<p>Hope that helps to point you in the right direction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-83731</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Thu, 26 May 2011 12:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-83731</guid>
		<description>Great guide for a jQuery noob like myself.

I am very new to JavaScript and jQuery (a couple of days new!) however i was wondering why you have use the setTimeout function instead of the jQuery delay() function.

Also do you know of any way I could set the tooltip to continue to display IF the user puts the mouse within the actual tooltip.</description>
		<content:encoded><![CDATA[<p>Great guide for a jQuery noob like myself.</p>
<p>I am very new to JavaScript and jQuery (a couple of days new!) however i was wondering why you have use the setTimeout function instead of the jQuery delay() function.</p>
<p>Also do you know of any way I could set the tooltip to continue to display IF the user puts the mouse within the actual tooltip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: turkiyes</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-83392</link>
		<dc:creator>turkiyes</dc:creator>
		<pubDate>Wed, 05 Jan 2011 00:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-83392</guid>
		<description>Thank you very much. Not only for the usefulness of your scripts, but also (and more important) for the teaching
The more of your articles I read, the more I learn to keep it simple</description>
		<content:encoded><![CDATA[<p>Thank you very much. Not only for the usefulness of your scripts, but also (and more important) for the teaching<br />
The more of your articles I read, the more I learn to keep it simple</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flip your Tip: Keeping the Event-delegation Tooltip in View &#187; Learning jQuery - Tips, Techniques, Tutorials</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-80024</link>
		<dc:creator>Flip your Tip: Keeping the Event-delegation Tooltip in View &#187; Learning jQuery - Tips, Techniques, Tutorials</dc:creator>
		<pubDate>Thu, 15 Apr 2010 20:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-80024</guid>
		<description>[...] Using setTimeout to Delay Showing Event Delegation Tooltips [...]</description>
		<content:encoded><![CDATA[<p>[...] Using setTimeout to Delay Showing Event Delegation Tooltips [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kuddl</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-80002</link>
		<dc:creator>kuddl</dc:creator>
		<pubDate>Mon, 12 Apr 2010 09:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-80002</guid>
		<description>Hi Karl, 
GREAT follow up posts!!

Still waiting for the next post!
Would love to see how you target that issue of viewport positioning.
Greez from Germany</description>
		<content:encoded><![CDATA[<p>Hi Karl,<br />
GREAT follow up posts!!</p>
<p>Still waiting for the next post!<br />
Would love to see how you target that issue of viewport positioning.<br />
Greez from Germany</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Smith</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-79860</link>
		<dc:creator>Dave Smith</dc:creator>
		<pubDate>Wed, 17 Mar 2010 22:12:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-79860</guid>
		<description>Hi Karl,

Just wondering what happens if you don&#039;t clear a Timer with clearTimeout()?

For example I am using setTimeout() to delay execution of a function once in JS. If i subsequently forget to clear that Timer does it result in a memory leak?

Also is there any way to check if any Timers are running?

Hope i&#039;m making sense?</description>
		<content:encoded><![CDATA[<p>Hi Karl,</p>
<p>Just wondering what happens if you don&#8217;t clear a Timer with clearTimeout()?</p>
<p>For example I am using setTimeout() to delay execution of a function once in JS. If i subsequently forget to clear that Timer does it result in a memory leak?</p>
<p>Also is there any way to check if any Timers are running?</p>
<p>Hope i&#8217;m making sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Nguyen</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-79754</link>
		<dc:creator>Peter Nguyen</dc:creator>
		<pubDate>Sun, 28 Feb 2010 08:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-79754</guid>
		<description>I think John.Johnson means the new delegate() function in jQuery 1.4. Maybe you should write another followup that use that function too?</description>
		<content:encoded><![CDATA[<p>I think John.Johnson means the new delegate() function in jQuery 1.4. Maybe you should write another followup that use that function too?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-79698</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Fri, 12 Feb 2010 21:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-79698</guid>
		<description>I&#039;m not sure which feature you&#039;re referring to. &lt;a href=&quot;https://developer.mozilla.org/en/DOM/window.setTimeout&quot; rel=&quot;nofollow&quot;&gt;setTimeout&lt;/a&gt; and &lt;a href=&quot;https://developer.mozilla.org/en/DOM/window.clearTimeout&quot; rel=&quot;nofollow&quot;&gt;clearTimeout&lt;/a&gt; are native JavaScript functions.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure which feature you&#8217;re referring to. <a href="https://developer.mozilla.org/en/DOM/window.setTimeout" rel="nofollow">setTimeout</a> and <a href="https://developer.mozilla.org/en/DOM/window.clearTimeout" rel="nofollow">clearTimeout</a> are native JavaScript functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John.Johnson</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-79683</link>
		<dc:creator>John.Johnson</dc:creator>
		<pubDate>Tue, 09 Feb 2010 08:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-79683</guid>
		<description>Is this a new feature in jQuery 1.4 ?</description>
		<content:encoded><![CDATA[<p>Is this a new feature in jQuery 1.4 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2009/12/using-settimeout-to-delay-showing-event-delegation-tooltips/comment-page-1#comment-79680</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Mon, 08 Feb 2010 12:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=972#comment-79680</guid>
		<description>Hi Nathan,
Yeah, sorry about the delay. I have the script ready to go, but I just haven&#039;t found time to write up the blog entry to go along with it. Will try to do so soon.</description>
		<content:encoded><![CDATA[<p>Hi Nathan,<br />
Yeah, sorry about the delay. I have the script ready to go, but I just haven&#8217;t found time to write up the blog entry to go along with it. Will try to do so soon.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 8/23 queries in 0.006 seconds using disk: basic
Object Caching 372/382 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 18:02:16 -->
