Created
July 3, 2011 22:33
-
-
Save henrik/1062679 to your computer and use it in GitHub Desktop.
Userscript to disable Google Maps scroll zoom in Google Chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable Google Maps scroll zoom in Google Chrome | |
// @namespace http://henrik.nyh.se | |
// @description Disables Google Maps scroll zoom because it's unusable with Apple's Magic Mouse. Confirmed to work in Google Chrome. | |
// @include http://maps.google.com/* | |
// ==/UserScript== | |
// Adapted from the Safari extension by Mario Tausch/Tiago Rodrigues (https://public.me.com/ix/mariotausch/dev/index.html) | |
// via http://www.leancrew.com/all-this/2011/05/the-google-maps-scrollzoom-confusion/. | |
var noop = function(e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
return false; | |
}; | |
var children = document.getElementById("map").childNodes; | |
for (var i=0, l=children.length; i<l; i++) { | |
children[i].addEventListener("mousewheel", noop, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment