Categories
JavaScript

How to disable Google Map scrolling on mobile devices

function initMap(){
    var isDraggable = $(document).width() > 480 ? true : false; // If document (your website) is wider than 480px, isDraggable = true, else isDraggable = false

    var mapOptions = {
        draggable: isDraggable,

        scrollwheel: false, // Prevent users to start zooming the map when scrolling down the page
        //... options options options
    };
}

Source: https://coderwall.com/p/pgm8xa/disable-google-maps-scrolling-on-mobile-layout

Categories
JavaScript Knowledge

JavaScript Jargon

Data Types
  • Numbers
  • Strings
  • Booleans
  • Arrays
  • Objects
    (built-in: window, document, and more objects have properties)
Veriables JavaScript’s nouns
Operators JavaScript’s verbs
Functions JavaScript’s paragraphs (also a data type)
Inside an object: a method
Arguments How we get data into a function for processing
Control Structures if, else, switch
Loops for, while
The DOM
  • DOM = Document Object Model
    The Outline of a page
    The method available for manipulating the goods
  • Lots of methods
    document.getElementById
    Fastest, but there are others
  • Lots of properties
    value, checked, className, id