如何禁用谷歌街景上的鼠标滚轮缩放?
考虑以下示例代码: http://code.google.com/apis/maps /documentation/javascript/examples/streetview-simple.html
我可以在地图选项上执行 scrollwheel: false
来禁用鼠标滚轮缩放。该功能未在街景全景选项上实现。
在 Chrome 中,我可以安全地禁用街景上的鼠标滚轮缩放。
$('#pano *').bind('mousewheel', function(){
return false;
});
然而这在其他地方不起作用。请帮助我让它在排名前 3-5 的浏览器中运行?
Consider the following example code:
http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html
I can do scrollwheel: false
on a mapOptions to disable mouse wheel zoom. The feature is not implemented on the streetview panoramaOptions.
In Chrome, I can safely disable mouse wheel zoom on the streetview simply by.
$('#pano *').bind('mousewheel', function(){
return false;
});
However this does not work in elsewhere. Please help me get it working in top 3-5 browsers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
现在有一个已确认的功能请求,涉及 Gmaps API 问题 http: //code.google.com/p/gmaps-api-issues/issues/detail?id=2557。我们希望谷歌的工程师在遇到更重要的错误时能够对此进行调查。我不想屏住呼吸,但我现在先把它停下来。
There is now a confirmed feature request with Gmaps API issues http://code.google.com/p/gmaps-api-issues/issues/detail?id=2557. Let's hope Google's engineers will look into it when they get trough more important bugs. I hate to hold my breath, but I'll park this for now.
根据 Subgurim.net 的说法,这是如何做到的;
我知道您正在使用 Javascript,这是一个 VB 示例,但希望它能有所帮助。
According to Subgurim.net, this is how to do it;
I realise that you are using Javascript, and this is a VB example, but hopefully it helps.
我使用下面的代码来避免双击缩放 - 非常确定它可以适应滚轮缩放。 Zoom: 1 是我最喜欢的变焦阶段,但可以是任何东西。
I use the below code to avoid double click zoom - pretty sure it could be adapted to scroll wheel zoom. zoom: 1 being my preferred zoom stage here, but could be anything.
有一个简单的解决方法:通过在街景之前添加一个具有较高 z-index 的图层,您将阻止街景的缩放功能。
There is an easy workaround: by adding a layer before the streetview with a higher z-index, you will prevent the zooming function of the Streetview.