<?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: JavaScript disable mouse wheel</title>
	<atom:link href="/2009/07/01/javascript-disable-mouse-wheel/feed/" rel="self" type="application/rss+xml" />
	<link>/2009/07/01/javascript-disable-mouse-wheel/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: SAM</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-16877</link>
		<dc:creator><![CDATA[SAM]]></dc:creator>
		<pubDate>Mon, 22 Oct 2012 16:28:20 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-16877</guid>
		<description><![CDATA[OPERA is wrong.. it does not work ..you have entered IExploer script again.]]></description>
		<content:encoded><![CDATA[<p>OPERA is wrong.. it does not work ..you have entered IExploer script again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adriaan</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-14428</link>
		<dc:creator><![CDATA[Adriaan]]></dc:creator>
		<pubDate>Tue, 13 Sep 2011 15:31:43 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-14428</guid>
		<description><![CDATA[It is really nice, I have adjusted the script since it was not working in IE, furthermore I combined it with this script:

http://solidlystated.com/scripting/javascript-disable-mouse-wheel/

Now this is my code, but it still won&#039;t work for IE, have I done something wrong?

/* IE7, IE8 */
			if(document.attachEvent){
				 document.attachEvent(&#039;onmousewheel&#039;, stopWheel, false);
			}
			
			/* Chrome, Safari, Firefox */
			else if(document.addEventListener){ 
			    document.addEventListener(&#039;DOMMouseScroll&#039;, stopWheel, false);
			}
			 
			function stopWheel(e){
				/* IE7, IE8, Chrome, Safari */
			    if(!e) { 
				    var e = window.event; 
				}
				
				/* Chrome, Safari, Firefox */
			    if(e.preventDefault) { 
					e.stopPropagation();
				    e.preventDefault();
				    e.cancelBubble = false; 
				}
				
				/* IE7, IE8 */
			   	e.returnValue = false;
				e.cancelBubble = true;
				return false;
			}]]></description>
		<content:encoded><![CDATA[<p>It is really nice, I have adjusted the script since it was not working in IE, furthermore I combined it with this script:</p>
<p><a href="http://solidlystated.com/scripting/javascript-disable-mouse-wheel/" rel="nofollow">http://solidlystated.com/scripting/javascript-disable-mouse-wheel/</a></p>
<p>Now this is my code, but it still won&#8217;t work for IE, have I done something wrong?</p>
<p>/* IE7, IE8 */<br />
			if(document.attachEvent){<br />
				 document.attachEvent(&#8216;onmousewheel&#8217;, stopWheel, false);<br />
			}</p>
<p>			/* Chrome, Safari, Firefox */<br />
			else if(document.addEventListener){<br />
			    document.addEventListener(&#8216;DOMMouseScroll&#8217;, stopWheel, false);<br />
			}</p>
<p>			function stopWheel(e){<br />
				/* IE7, IE8, Chrome, Safari */<br />
			    if(!e) {<br />
				    var e = window.event;<br />
				}</p>
<p>				/* Chrome, Safari, Firefox */<br />
			    if(e.preventDefault) {<br />
					e.stopPropagation();<br />
				    e.preventDefault();<br />
				    e.cancelBubble = false;<br />
				}</p>
<p>				/* IE7, IE8 */<br />
			   	e.returnValue = false;<br />
				e.cancelBubble = true;<br />
				return false;<br />
			}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Furkan Tunalı</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-14175</link>
		<dc:creator><![CDATA[Furkan Tunalı]]></dc:creator>
		<pubDate>Wed, 02 Feb 2011 01:06:32 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-14175</guid>
		<description><![CDATA[Thanks for your nice article, it helped a lot.

In addition, for the people who wants to check if function defined they can use typeof, ie: &lt;pre lang=&quot;javascript&quot;&gt;if(typeof document.attachEvent == &#039;function&#039;)&lt;/pre&gt;

&lt;strong&gt;@Akkara,&lt;/strong&gt;
e object will give you the scroll x,y nodes. Comment out a console.log from the code below for your browser spesific function, you&#039;ll see what your browser will gives you. On chrome e.offsetX, e.offsetY, e.pageX, e.pageY, e.screenX, e.screenY etc..

&lt;pre lang=&quot;javascript&quot;&gt;
	if(typeof document.attachEvent == &#039;function&#039;) { //IE
		document.attachEvent(&#039;onmousewheel&#039;, function(e){
			//console.log(e);
		     if (!e) var e = window.event;
		     e.returnValue = false;
		     e.cancelBubble = true;
		     return false;
		}, false);
	} else if(typeof document.addEventListener == &#039;function&#039;) { //WEBKIT
		document.addEventListener(&#039;mousewheel&#039;, function(e){
			//console.log(e);
		    e.stopPropagation();
		    e.preventDefault();
		    e.cancelBubble = false;
		    return false;
		}, false);
	} else if(typeof document.attachEvent == &#039;function&#039;) { //OPERA
		document.attachEvent(&#039;mousewheel&#039;, function(e){
			//console.log(e);
		    if (!e) var e = window.event;
		    e.returnValue = false;
		    e.cancelBubble = true;
		    return false;
		}, false);
	} else if(typeof document.addEventListener == &#039;function&#039;) { //GECKO
		document.addEventListener(&#039;DOMMouseScroll&#039;, function(e){
			//console.log(e);
		    e.stopPropagation();
		    e.preventDefault();
		    e.cancelBubble = false;
		    return false;
		}, false);
	}
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Thanks for your nice article, it helped a lot.</p>
<p>In addition, for the people who wants to check if function defined they can use typeof, ie: </p>
<pre lang="javascript">if(typeof document.attachEvent == 'function')</pre>
<p><strong>@Akkara,</strong><br />
e object will give you the scroll x,y nodes. Comment out a console.log from the code below for your browser spesific function, you&#8217;ll see what your browser will gives you. On chrome e.offsetX, e.offsetY, e.pageX, e.pageY, e.screenX, e.screenY etc..</p>
<pre lang="javascript">
	if(typeof document.attachEvent == 'function') { //IE
		document.attachEvent('onmousewheel', function(e){
			//console.log(e);
		     if (!e) var e = window.event;
		     e.returnValue = false;
		     e.cancelBubble = true;
		     return false;
		}, false);
	} else if(typeof document.addEventListener == 'function') { //WEBKIT
		document.addEventListener('mousewheel', function(e){
			//console.log(e);
		    e.stopPropagation();
		    e.preventDefault();
		    e.cancelBubble = false;
		    return false;
		}, false);
	} else if(typeof document.attachEvent == 'function') { //OPERA
		document.attachEvent('mousewheel', function(e){
			//console.log(e);
		    if (!e) var e = window.event;
		    e.returnValue = false;
		    e.cancelBubble = true;
		    return false;
		}, false);
	} else if(typeof document.addEventListener == 'function') { //GECKO
		document.addEventListener('DOMMouseScroll', function(e){
			//console.log(e);
		    e.stopPropagation();
		    e.preventDefault();
		    e.cancelBubble = false;
		    return false;
		}, false);
	}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akkara</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-12980</link>
		<dc:creator><![CDATA[Akkara]]></dc:creator>
		<pubDate>Thu, 06 May 2010 08:12:12 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-12980</guid>
		<description><![CDATA[Thank you. So how do we get the wheel value?]]></description>
		<content:encoded><![CDATA[<p>Thank you. So how do we get the wheel value?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoimen</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-12462</link>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
		<pubDate>Fri, 26 Feb 2010 08:17:46 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-12462</guid>
		<description><![CDATA[Well this code can simply be wrapped into a jQuery shell, which was my case. 

greetings,
stoimen]]></description>
		<content:encoded><![CDATA[<p>Well this code can simply be wrapped into a jQuery shell, which was my case. </p>
<p>greetings,<br />
stoimen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miro Zografski</title>
		<link>/2009/07/01/javascript-disable-mouse-wheel/comment-page-1/#comment-12461</link>
		<dc:creator><![CDATA[Miro Zografski]]></dc:creator>
		<pubDate>Fri, 26 Feb 2010 08:02:52 +0000</pubDate>
		<guid isPermaLink="false">/?p=635#comment-12461</guid>
		<description><![CDATA[You really should set examples in jQuery as well.]]></description>
		<content:encoded><![CDATA[<p>You really should set examples in jQuery as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
