【问题标题】:Disable mouse wheel zoom in wordpress plugin在 wordpress 插件中禁用鼠标滚轮缩放
【发布时间】:2020-04-27 13:50:02
【问题描述】:

我试图在滚动页面时避免那种恼人的缩放效果。

我在显示传单的 iframe 中。

我已使用此代码来防止缩放:

<div class="overlay" onClick="style.pointerEvents='none'"></div>

.overlay {
    background: transparent;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    margin-top: 49px;
}

它在缩放时效果很好,但它也可以防止点击导航箭头。

有没有办法完全禁用鼠标滚轮的缩放并保持点击处于活动状态? 或者更好的是,有没有办法在按下ctrl 键时让它缩放?

【问题讨论】:

  • “滚动页面时令人讨厌的缩放效果” - 什么讨厌的缩放效果?
  • 当它阻止滚动并开始缩放时
  • 从未发生过这种情况 - 您有硬件问题吗?是否通过 RDP 连接速度较慢?
  • no... 是一个 100% 宽度的 iframe,因此它占据了所有页面宽度。谷歌地图通常会发生同样的事情..

标签: javascript wordpress zooming mousewheel


【解决方案1】:

来自documentation

Name : scrollWheelZoom
Type : Boolean|String
Default : true
Description : Whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was.

将 scrollWheelZoom 设置为 false。

【讨论】:

  • 我的问题不在谷歌地图上.. 是一个 wordpress 插件,可以在翻书中显示 pdf
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-26
相关资源
最近更新 更多