禁用谷歌地图缩放鼠标悬停不适用于IE浏览器

时间:2016-02-03 07:41:56

标签: javascript jquery html css css3

下面的代码是停止地图缩放鼠标悬停滚动在所有浏览器中只有IE没有接受它。当我向下滚动页面并且鼠标在地图上出现时,它停止滚动页面并开始在IE上缩放谷歌地图

$(document).ready(function () {

        // you want to enable the pointer events only on click;

        $('#map_canvas1').addClass('scrolloff'); // set the pointer events to none on doc ready
        $('#canvas1').on('click', function () {
            $('#map_canvas1').removeClass('scrolloff'); // set the pointer events true on click
        });

        // you want to disable pointer events when the mouse leave the canvas area;

        $("#map_canvas1").mouseleave(function () {
            $('#map_canvas1').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area
        });
    });

<div id="canvas1" class="map">
     <iframe id="map_canvas1" src="https://www.google.com/maps/embe...." width="1170" height="400" frameborder="0" style="border: 0"></iframe>
</div>

0 个答案:

没有答案