<?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: jQuery Context Menu Unbind Click Fix</title>
	<atom:link href="http://www.timgittos.com/jquery-context-menu-unbind-click-fix/feed" rel="self" type="application/rss+xml" />
	<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=jquery-context-menu-unbind-click-fix</link>
	<description>professional bit pusher</description>
	<lastBuildDate>Thu, 08 Jul 2010 10:20:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: cifroes</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-227</link>
		<dc:creator>cifroes</dc:creator>
		<pubDate>Wed, 21 Apr 2010 08:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-227</guid>
		<description>Please note that this fix doesn&#039;t work if you use multiple menus in the same page with the same &lt;ul&gt;. (same menu associated with several links)&lt;br&gt;&lt;br&gt;My fix is to put the ondocumentclick at the top of the page:&lt;br&gt;if (jQuery)( function() {&lt;br&gt;&lt;br&gt;    // External click event for document&lt;br&gt;    var onDocumentClick = function () {&lt;br&gt;        $(document).unbind(&#039;click&#039;, onDocumentClick //.unbind(&#039;keypress&#039;);&lt;br&gt;        $(&quot;.contextMenu&quot;).hide();&lt;br&gt;        return false;&lt;br&gt;    };&lt;br&gt;&lt;br&gt;&lt;br&gt;And add:&lt;br&gt;// Show the menu&lt;br&gt;$(document).unbind(&#039;click&#039;, onDocumentClick</description>
		<content:encoded><![CDATA[<p>Please note that this fix doesn&#39;t work if you use multiple menus in the same page with the same &lt;ul&gt;. (same menu associated with several links)</p>
<p>My fix is to put the ondocumentclick at the top of the page:<br />if (jQuery)( function() {</p>
<p>    // External click event for document<br />    var onDocumentClick = function () {<br />        $(document).unbind(&#39;click&#39;, onDocumentClick //.unbind(&#39;keypress&#39;);<br />        $(&#8220;.contextMenu&#8221;).hide();<br />        return false;<br />    };</p>
<p>And add:<br />// Show the menu<br />$(document).unbind(&#39;click&#39;, onDocumentClick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob B</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-226</link>
		<dc:creator>Rob B</dc:creator>
		<pubDate>Mon, 15 Feb 2010 12:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-226</guid>
		<description>Thanks so much! This sorted everything out perfectly! Awesome!</description>
		<content:encoded><![CDATA[<p>Thanks so much! This sorted everything out perfectly! Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob B</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-299</link>
		<dc:creator>Rob B</dc:creator>
		<pubDate>Mon, 15 Feb 2010 12:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-299</guid>
		<description>Thanks so much! This sorted everything out perfectly! Awesome!</description>
		<content:encoded><![CDATA[<p>Thanks so much! This sorted everything out perfectly! Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-225</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 03 Feb 2010 20:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-225</guid>
		<description>I have a strange issue and this seems to be the only place on google I could track down that has done extra work with this.  Basically, I am trying to dynamically have multiple menus for the same div, and the menu that comes up will be based on the item you are currently hovering over.

It seems as though what is happening is that as soon as the menu is loaded for a div, it stays there.  Do you know a way to possibly destroy the current menu and reload a new menu on every mouse click on a div?</description>
		<content:encoded><![CDATA[<p>I have a strange issue and this seems to be the only place on google I could track down that has done extra work with this.  Basically, I am trying to dynamically have multiple menus for the same div, and the menu that comes up will be based on the item you are currently hovering over.</p>
<p>It seems as though what is happening is that as soon as the menu is loaded for a div, it stays there.  Do you know a way to possibly destroy the current menu and reload a new menu on every mouse click on a div?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-298</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 03 Feb 2010 20:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-298</guid>
		<description>I have a strange issue and this seems to be the only place on google I could track down that has done extra work with this.  Basically, I am trying to dynamically have multiple menus for the same div, and the menu that comes up will be based on the item you are currently hovering over.

It seems as though what is happening is that as soon as the menu is loaded for a div, it stays there.  Do you know a way to possibly destroy the current menu and reload a new menu on every mouse click on a div?</description>
		<content:encoded><![CDATA[<p>I have a strange issue and this seems to be the only place on google I could track down that has done extra work with this.  Basically, I am trying to dynamically have multiple menus for the same div, and the menu that comes up will be based on the item you are currently hovering over.</p>
<p>It seems as though what is happening is that as soon as the menu is loaded for a div, it stays there.  Do you know a way to possibly destroy the current menu and reload a new menu on every mouse click on a div?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-224</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-224</guid>
		<description>Thank you so much for this article, this bug haunted me for like forever.</description>
		<content:encoded><![CDATA[<p>Thank you so much for this article, this bug haunted me for like forever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-297</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-297</guid>
		<description>Thank you so much for this article, this bug haunted me for like forever.</description>
		<content:encoded><![CDATA[<p>Thank you so much for this article, this bug haunted me for like forever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-206</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 11 Aug 2009 15:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-206</guid>
		<description>Hey Peter, thanks for that. I&#039;ll look at the full copy of the source I keep and see if I can roll those into it.</description>
		<content:encoded><![CDATA[<p>Hey Peter, thanks for that. I&#8217;ll look at the full copy of the source I keep and see if I can roll those into it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-296</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 11 Aug 2009 15:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-296</guid>
		<description>Hey Peter, thanks for that. I&#039;ll look at the full copy of the source I keep and see if I can roll those into it.</description>
		<content:encoded><![CDATA[<p>Hey Peter, thanks for that. I&#8217;ll look at the full copy of the source I keep and see if I can roll those into it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PeterTheNiceGuy</title>
		<link>http://www.timgittos.com/jquery-context-menu-unbind-click-fix/comment-page-1#comment-205</link>
		<dc:creator>PeterTheNiceGuy</dc:creator>
		<pubDate>Mon, 10 Aug 2009 16:44:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.timgittos.com/?p=347#comment-205</guid>
		<description>Thanks a lot for your fix! 
I think I had the same problem as Thomas. When I clicked once outside the context menu, it disapeared as expected, but then it would never show again because as soon as it shows, the onDocumentClick would kick in and hide it again.

I fixed it by changing this line:
$(document).unbind(&quot;click&quot;, this)
to
$(document).unbind(&quot;click&quot;, onDocumentClick)

The this in the onDocumentClick function is not the function itself.

Another thing I fixed:
somehow the unbind of the menu elements was not working for me. When you choose the Edit menu for the first time the Alert shows up once. When you then right-click and choose edit again, the alert shows 2 times, then 3 times etc.
I fixed that by unbinding the click event in the click event handler of the menu item:
$(&#039;#&#039; + o.menu).find(&#039;li:not(.disabled) a&#039;).click(function() {
  $(this).unbind(&#039;click&#039;);
  ...

hope it helps someone. took me some time to figure out</description>
		<content:encoded><![CDATA[<p>Thanks a lot for your fix!<br />
I think I had the same problem as Thomas. When I clicked once outside the context menu, it disapeared as expected, but then it would never show again because as soon as it shows, the onDocumentClick would kick in and hide it again.</p>
<p>I fixed it by changing this line:<br />
$(document).unbind(&#8220;click&#8221;, this)<br />
to<br />
$(document).unbind(&#8220;click&#8221;, onDocumentClick)</p>
<p>The this in the onDocumentClick function is not the function itself.</p>
<p>Another thing I fixed:<br />
somehow the unbind of the menu elements was not working for me. When you choose the Edit menu for the first time the Alert shows up once. When you then right-click and choose edit again, the alert shows 2 times, then 3 times etc.<br />
I fixed that by unbinding the click event in the click event handler of the menu item:<br />
$(&#8216;#&#8217; + o.menu).find(&#8216;li:not(.disabled) a&#8217;).click(function() {<br />
  $(this).unbind(&#8216;click&#8217;);<br />
  &#8230;</p>
<p>hope it helps someone. took me some time to figure out</p>
]]></content:encoded>
	</item>
</channel>
</rss>
