<?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: Disable Selction on Menu Items with this jQuery Extension</title>
	<atom:link href="http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/feed/" rel="self" type="application/rss+xml" />
	<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/</link>
	<description>tech, web and the rest</description>
	<lastBuildDate>Fri, 27 Jan 2012 13:37:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Aleem</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-35437</link>
		<dc:creator>Aleem</dc:creator>
		<pubDate>Thu, 06 Jan 2011 08:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-35437</guid>
		<description>&lt;p&gt;Thomas, great find. I have updated the post so jQuery UI Core users can benefit from this.&lt;/p&gt;

&lt;p&gt;Turns out jQuery UI code &lt;a href=&quot;https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.core.js#L120&quot; rel=&quot;nofollow&quot;&gt;disables selections&lt;/a&gt; by calling &lt;code&gt;preventDefault()&lt;/code&gt; on &lt;code&gt;mousedown&lt;/code&gt; event (or &lt;code&gt;selectstart&lt;/code&gt; event if the user agent supports it). So even without jQuery UI it might be possible to achieve the same by just copying their implementation.&lt;/p&gt;

&lt;p&gt;The UI Core implementation also adds a &lt;code&gt;ui-disableSelection&lt;/code&gt; class to the element so if the implementation is copied verbatim, it&#039;s possible to use the CSS for &lt;code&gt;.button&lt;/code&gt; for &lt;code&gt;.ui-disableSelection&lt;/code&gt; instead.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Thomas, great find. I have updated the post so jQuery UI Core users can benefit from this.</p>
<p>Turns out jQuery UI code <a href="https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.core.js#L120" rel="nofollow">disables selections</a> by calling <code>preventDefault()</code> on <code>mousedown</code> event (or <code>selectstart</code> event if the user agent supports it). So even without jQuery UI it might be possible to achieve the same by just copying their implementation.</p>
<p>The UI Core implementation also adds a <code>ui-disableSelection</code> class to the element so if the implementation is copied verbatim, it&#8217;s possible to use the CSS for <code>.button</code> for <code>.ui-disableSelection</code> instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-35423</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 05 Jan 2011 13:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-35423</guid>
		<description>&lt;p&gt;Included in the core library of jQuery UI are two functions: enableSelection() and disableSelection(). They do not show up in the documentation, but they are in there :)&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Included in the core library of jQuery UI are two functions: enableSelection() and disableSelection(). They do not show up in the documentation, but they are in there :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleem</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-34013</link>
		<dc:creator>Aleem</dc:creator>
		<pubDate>Mon, 27 Sep 2010 21:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-34013</guid>
		<description>&lt;p&gt;Thanks for bringing it up though, I updated the post since it&#039;s easy to gloss over the comments. The code is a bit more air-tight now. I don&#039;t use the Javascript solution anymore though since the CSS-only solution works rather well on modern browsers.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for bringing it up though, I updated the post since it&#8217;s easy to gloss over the comments. The code is a bit more air-tight now. I don&#8217;t use the Javascript solution anymore though since the CSS-only solution works rather well on modern browsers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-34011</link>
		<dc:creator>Charlie</dc:creator>
		<pubDate>Mon, 27 Sep 2010 19:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-34011</guid>
		<description>&lt;p&gt;I should read other&#039;s comments before replying, huh? :-o&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I should read other&#8217;s comments before replying, huh? :-o</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-34010</link>
		<dc:creator>Charlie</dc:creator>
		<pubDate>Mon, 27 Sep 2010 19:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-34010</guid>
		<description>&lt;p&gt;you should return the result of each so that it&#039;s chainable.&lt;/p&gt;

&lt;code&gt;jQuery.fn.disableSelection = function() { 
    return this.each(function() { 
        this.onselectstart = function() { return false; }; 
        this.unselectable = &quot;on&quot;; 
        jQuery(this).css(&#039;-moz-user-select&#039;, &#039;none&#039;); 
    });
};
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>you should return the result of each so that it&#8217;s chainable.</p>
<p><code>jQuery.fn.disableSelection = function() {<br />
    return this.each(function() {<br />
        this.onselectstart = function() { return false; };<br />
        this.unselectable = "on";<br />
        jQuery(this).css('-moz-user-select', 'none');<br />
    });<br />
};<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-33453</link>
		<dc:creator>Dinesh</dc:creator>
		<pubDate>Thu, 15 Jul 2010 05:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-33453</guid>
		<description>&lt;p&gt;It works well. Thanks for this extension. &lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>It works well. Thanks for this extension. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-29656</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Sat, 31 Oct 2009 22:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-29656</guid>
		<description>&lt;p&gt;Since Safari 3+, Webkit has used a different synax (&lt;a href=&quot;http://developer.apple.com/mac/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;):&lt;/p&gt;

&lt;code&gt;-webkit-user-select
&lt;/code&gt;

&lt;p&gt;... and I had to explicitly &lt;code&gt;return&lt;/code&gt;, or I got errors, so --&lt;/p&gt;

&lt;code&gt;disableSelection : function() { 
   return this.each(function() { 
   ...
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Since Safari 3+, Webkit has used a different synax (<a href="http://developer.apple.com/mac/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html" rel="nofollow">docs</a>):</p>
<p><code>-webkit-user-select<br />
</code></p>
<p>&#8230; and I had to explicitly <code>return</code>, or I got errors, so &#8211;</p>
<p><code>disableSelection : function() {<br />
   return this.each(function() {<br />
   ...<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-28562</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 31 Jul 2009 19:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-28562</guid>
		<description>&lt;p&gt;or you could add 3 simple lines to your stylesheet&lt;/p&gt;

&lt;code&gt;#map {
    -moz-user-select: none;
   -khtml-user-select: none;
   user-select: none;}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>or you could add 3 simple lines to your stylesheet</p>
<p><code>#map {<br />
    -moz-user-select: none;<br />
   -khtml-user-select: none;<br />
   user-select: none;}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Andrieu</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-28364</link>
		<dc:creator>Joe Andrieu</dc:creator>
		<pubDate>Mon, 06 Jul 2009 09:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-28364</guid>
		<description>&lt;p&gt;Clean, indeed. Worked at first attempt.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Clean, indeed. Worked at first attempt.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alpenmilch</title>
		<link>http://aleembawany.com/2009/01/20/disable-selction-on-menu-items-with-this-jquery-extension/comment-page-1/#comment-27640</link>
		<dc:creator>Alpenmilch</dc:creator>
		<pubDate>Mon, 30 Mar 2009 11:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://aleembawany.com/?p=423#comment-27640</guid>
		<description>Thanks for this nice and clean solution, works like a charm!</description>
		<content:encoded><![CDATA[<p>Thanks for this nice and clean solution, works like a charm!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
