How To Disable Scroll Effect In Map Using CSS And Jquery

Here we learn about how to disable the scroll effect on the map using CSS and Jquery.

Here is an example of code for disabling scroll on mouse scroll.

    .scrolloff {
      pointer-events: none;
    <div id="googlemap" class="map">
      <iframe id="gmap" src="
      &q=Space+Needle,Seattle+WA" width="100%" height="500" frameborder="0" ></iframe>

      $( document ).ready( function () {
        $( '#gmap' ).addClass( 'scrolloff' );
        $( '#googlemap' ).on( 'mouseup', function(){
          $( '#gmap' ).addClass( 'scrolloff' );
        $( '#googlemap' ).on( 'mousedown', function(){
          $( '#gmap' ).removeClass( 'scrolloff' );

        $( '#gmap' ).mouseleave( function () {
          $( '#gmap' ).addClass( 'scrolloff' );

Submit a Comment

Your email address will not be published. Required fields are marked *


Select Categories