Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ inertia Public
forked from yued-fe/inertia

移动设备上任意元素在屏幕内惯性弹动

License

Notifications You must be signed in to change notification settings

issuz/inertia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

inertia

移动设备上任意元素在屏幕内惯性弹动

原生JavaScript编写,适用于触屏设备。

使用示意

1. 引入JS文件,例如

<script src="Inertia.js"></script>

2. 绑定

new Inertia(ele);

语法

new Inertia(ele, option);

其中:

  • ele表示拖移弹动的元素;
  • option为可选参数,包括:
    • edge,布尔值,表示是否吸附边缘,默认为true,也就是吸附。

补充说明

有时候希望元素不是紧靠边缘而是留有间隙,可以使用透明边框,或者标签嵌套使用padding等CSS属性控制。

About

移动设备上任意元素在屏幕内惯性弹动

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%

AltStyle によって変換されたページ (->オリジナル) /