Created
          October 28, 2015 11:13 
        
      - 
      
- 
        Save lilumi/9f158b547e3baf6ecc39 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Just set the pointer-events: none CSS to the <iframe> to disable mouse scroll. | |
| /* | |
| <div id="gmap-holder"> | |
| <iframe width="100%" height="400" frameborder="0" style="border:0; pointer-events:none" | |
| src="https://www.google.com/maps/embed/v1/place?q=XXX&key=YYY"></iframe> | |
| </div> | |
| If you want the mouse scroll to be activated when the user clicks into the map, then use the following JS code. | |
| It will also disable the mouse scroll again, when the mouse moves out of the map. | |
| */ | |
| $('#gmap-holder').click(function(e) { | |
| $(this).find('iframe').css('pointer-events', 'all'); | |
| }).mouseleave(function(e) { | |
| $(this).find('iframe').css('pointer-events', 'none'); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment