简体   繁体   English

Wordpress 27:如何自定义“向下滚动箭头”Javascript 文件

[英]Wordpress Twenty Seventeen: How to customize the "scroll down arrow" Javascript file

WordPress' Twenty Seventeen theme comes bundled with a small arrow on the bottom-right of the screen who's class is menu-scroll-down . WordPress 的 27 岁主题在屏幕右下角捆绑了一个小箭头,该箭头的类别是menu-scroll-down It makes a smooth scrolling effect to the content.它对内容产生平滑的滚动效果。 I'd like to customize the scrolling speed.我想自定义滚动速度。

I've found the JavaScript file in assets\js\jquery.scrollTo.js , but I'm not sure I'm at the right place, and I can't seem to make the changes I want.我在assets\js\jquery.scrollTo.js中找到了 JavaScript 文件,但我不确定我在正确的位置,而且我似乎无法进行我想要的更改。 I can't find where in the JavaScript is the .menu-scroll-down class mentioned, either.我也找不到提到的.menu-scroll-down类在 JavaScript 中的哪个位置。

Does anyone know where to change these parameters?有谁知道在哪里更改这些参数?

Find global.js that is in the same directory as assets\js\jquery.scrollTo.js then find the following code找到和assets\js\jquery.scrollTo.js同目录的global.js然后找到下面的代码

$menuScrollDown.click( function( e ) {
    e.preventDefault();
    $( window ).scrollTo( '#primary', {
            duration: 600,
            offset: { top: menuTop - navigationOuterHeight }
    });
});

and then change the duration to change the scroll speed.然后更改duration以更改滚动速度。

https://themes.trac.wordpress.org/browser/twentyseventeen/1.4/assets/js/global.js#L200 https://themes.trac.wordpress.org/browser/twentyseventeen/1.4/assets/js/global.js#L200

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM