微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

moveTo

编程之家收集整理的这个编程导航主要介绍了moveTo编程之家,现在分享给大家,也给大家做个参考。

moveto 介绍

一个轻量级(只有1kb gzip)滚动动画JavaScript库,没有任何依赖。 

moveto安装

使用npm

npm install moveto --save

使用yarn

yarn add moveto

使用Bower

bower install moveto --save

moveto用法

const moveto = new Moveto();

const target = document.getElementById('target');

moveto.move(target);

// Or register a trigger

const trigger = document.getElementsByClassName('js-trigger')[0];

moveto.registerTrigger(trigger);

触发html标记

您可以将所有选项作为带有mt前缀的数据属性传递。选项名称应以烤肉串案例格式编写,例如

<a href="#target" class="js-trigger" data-mt-duration="300">Trigger</a>

<!-- Or -->

<button type="button" class="js-trigger" data-target="#target" data-mt-duration="300">Trigger</button>

网站地址:https://hsnaydd.github.io/moveTo/demo/

GitHub:https://github.com/hsnaydd/moveTo

网站描述:一个轻量级滚动动画javascript库没有任何依赖

moveTo

官方网站:https://hsnaydd.github.io/moveTo/demo/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。