Streaming live at 10am (PST)

How to disable map scrolling using Google API on webflow sites


#1

Hello,

I wanted to disable scrolling maps on mobile devices,
So I added this code to the initMaps function in webflow.js

var isDraggable = $(document).width() > 480 ? true : false;
var mapOptions = {
draggable: isDraggable,
scrollwheel:false,
};

But When testing it, it didn't work;
What could have gone wrong?

Thanks in Advance.
Khaled


#2

You probably want

var isDraggable = $(window).width() > 480;

#3