谷歌地图iframe禁用移动触摸滚动 [英] Google maps iframe disable scrolling touch on mobile
本文介绍了谷歌地图iframe禁用移动触摸滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在移动设备上停用Google地图iframe吗?
设置已包含滚动=否,但当我在移动设备上滚动时,地图被激活并变为活动状态。
有没有解决方法?
/ b>
解决方案
我有类似的问题,并使用类似这样的内容:
<风格>
.overlay {
background:transparent;
职位:亲属;
width:640px
height:480px;
top:480px;
margin-top:-480px;}
< / style>
< html>
< div class =overlayonClick =style.pointerEvents ='none'>< / div>
< iframe src =https://mapsengine.google.com/map/embed?mid=some_map_idwidth =640height =480>< / iframe>
< / html>
div覆盖地图,防止指针事件进入。如果你点击div,它对指针事件变得透明,激活地图。
Can I deactivate the google maps iframe when i'm on a mobile device?
Settings are already with scrolling=no, but when I scroll on mobile the map is activated and become active.
Is there a solution?
Thanks
解决方案
I had a similar problem and used something like this:
<style>
.overlay {
background:transparent;
position:relative;
width:640px
height:480px;
top:480px;
margin-top:-480px;}
</style>
<html>
<div class="overlay" onClick="style.pointerEvents='none'"></div>
<iframe src="https://mapsengine.google.com/map/embed?mid=some_map_id" width="640" height="480"></iframe>
</html>
The div covers the map, preventing pointer events from getting to it. If you click on the div, it becomes transparent to pointer events, activating the map.
这篇关于谷歌地图iframe禁用移动触摸滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文