推荐几款vue滚动scroll插件

2020-12-01 16:49:13

浏览器滚动效果,重写滚动条,我们可以选择第三方插件。iScroll 或者 better-scroll

iScroll better-scroll 他们各有千秋,大家看着办吧。



监听滚动,做效果,我推荐  vue-scroll  ,使用这个插件,我们可以轻松的解决 

throttle

debounce

问题


throttle和debounce的区别 参考连接 throttle 和 debounce区别和用法


无论怎么找vue插件,实现div内的平滑滚动效果,还是我大 jquery,最后还是加载了jquery插件


参看地址 nuxtjs引入jquery



通过几句jquery代码实现页面平滑滚动到某一锚点的效果。实现代码来源于https://css-tricks.com/snippets/jquery/smooth-scrolling

实现的jquery代码如下:

$('a[href*="#"]:not([href="#"])').click(function() {
            if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
                var target = $(this.hash);
                target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
                if (target.length) {
                    $('html, body').animate({
                        scrollTop: target.offset().top
                    }, 1000);
                    return false;
                }
            }
        });


  • 2017-12-25 11:07:58

    mogodb 备份

    error connecting to db server: server returned error on SASL authentication

  • 2017-12-25 15:53:15

    MongoDB3.4版本配置详解

    配置文件方面,mongod和mongos有很多相同之处,下文中如有区别之处将会特别指出。 在一个节点上,通常同时启动mongod和mongos进程是正常的,他们之间不存在资源竞争,但是为了避免冲突,我们希望它们使用各自的配置文件,比如mongod.conf、mongos.conf;mongodb的某些平台下的安装包中没有自带配置文件,需要开发者自己创建。