Disable mouse scroll wheel scaling with google maps v3 while in infoindust
I'm trying to disable mouse wheel scaling on my maps, but it doesn't seem to work (although I'm sure it worked, maybe something changed).
Anyway, I have those custom info windows that pop up when users click on the map markers, and sometimes they have a fair amount of content in which a scrollbar appears in them. I want to make sure that when people scroll, the contents of the infowindow scrolls and that the map stays the same.
My code (coffeescript):
# Disable map Dragging when cursor enters infoBox div
$(document).on "mouseenter", ".infobox-content", () ->
googleMap.setOptions( {draggable:false, scrollwheel:false} )
$(document).on "mouseleave", ".infobox-content", () ->
googleMap.setOptions( {draggable:true, scrollwheel:true} )
I made sure that events were fired when appropriate and that events were set up correctly, but it still doesn't work.
Other similar questions that tell me to do exactly what I am doing:
- How to disable mouse wheel scaling using the Google Maps API
- Google Maps API v3 won't disable scroll wheel after map load
this works for me (FF, Chrome):
infowindow.open(map, marker);
$('.gm-style-iw').on('wheel', function (e) {
e.stopPropagation();
});
you have to bind the eventlistener every time you call infowindow.open();
I don't know if this solution has been fixed, but it has been fixed.
I have not specified the version of the gem for jquery-rails
and noticed that the version for jQuery is now 1.9. After specifying the version, ~> 2.1.4
jQuery was now fixed at 1.8 and my problem was gone.