Categories

有特色的模板

WordPress. 如何启用/禁用谷歌地图上的鼠标滚轮滚动缩放

Andre Flores 2015年9月22日
Rating: 5.0/5. From 3 votes.
Please wait...

Hello! 本视频教程展示了如何 enable/disable 鼠标滚轮滚动缩放 在谷歌地图 WordPress模板.

WordPress. 如何启用/禁用谷歌地图上的鼠标滚轮滚动缩放

You may have a Google Map 在首页的底部 WordPress模板:

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_1

Hover 在地图上,试着用鼠标滚轮滚动-你可以看到地图 zooms in/out while scrolling.

您可能需要禁用此功能 function 因为它有时很烦人, 当您想简单地向上滚动页面并将地图缩小时.

否则,你可能会想要 zoom 启用后,您的网站访问者可以很容易地导航到所需的位置在地图上使用 鼠标滚轮滚动缩放.

让我们来学习如何管理它 function.

本教程假设您已经登录到WordPress dashboard.

  1. Navigate to Appearance -> Editor tab in the dashboard:

    wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_2

  2. Click the static-map.php 右侧标题打开文件进行编辑:

    wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_3

  3. 打开文件编辑界面后,使用 CTRL+F/CMND+F key (Windows OS/Mac OS) 查找下面的代码片段:

var mapOptions

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_4

你可以看到下面的代码块:

//你希望地图开始时的放大程度(总是必需的)
zoom: ,
scrollwheel:没错,

你可以看到 scrollwheel function is set to “true” by default.

将其替换为 “false” 禁用鼠标滚轮滚动,代码如下所示:

//你希望地图开始时的放大程度(总是必需的)
zoom: ,
scrollwheel:假的,

Click the Update File” 按钮在屏幕的下部应用更改:

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_5

导航到站点前端并刷新页面以查看更改.

你可以看到 地图鼠标滚轮滚动缩放 is disabled now.

本教程到此结束. 你已经学会了 启用/禁用鼠标滚轮滚动缩放 你的WordPress模板的谷歌地图.

请随时查看下面的详细视频教程:

WordPress. 如何启用/禁用谷歌地图上的鼠标滚轮滚动缩放

现代Wordpress主题
这个条目被张贴了出来 WordPress教程 and tagged google map, mousewheel, WordPress, Zoom. Bookmark the permalink.

提交罚单

如果您仍然无法找到关于您的问题的足够的教程,请使用以下链接向我们的技术支持团队提交请求. 我们将在接下来的24小时内为您提供我们的帮助和协助: 提交罚单