T
T
Tenebrius2016-01-18 15:27:18
HTML
Tenebrius, 2016-01-18 15:27:18

How to disable the scrolling of the Google Maps built into the site on phones?

There is a Google map on the site, embedded through a standard iframe. How to make the entire page scroll instead of the map on touch devices?

<iframe src="https://www.google.com/maps/embed?..." 
width="100%" height="450" 
frameborder="0" style="border:0" allowfullscreen></iframe>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yesworld, 2016-11-24
@Tenebrius

If you use Api goole, then you need to disable scrolling through options when initializing the map.
If the map created through the constructor is loaded into an iframe, then you cut it out with the mouse action style:

iframe {
pointer-events: none;
}

You hang a click handler on the iframe itself, which changes css when clicked.
$('iframe').click(function(){
 $(this).css('pointer-events','auto');
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question