myScroll Native Scrollbar Plugin (Original)

Add-ons
2026-07-25 23:11 4 次浏览 • 0 次下载 3.3KB
myScroll Native Scrollbar Plugin (Original)

Last updated: 2020-06-14 23:22:57

Features:

1. Display reading progress at the top of the page.

2. Refresh data when scrolling to the bottom.

3. Trigger animations at specified scroll positions.

4. ...

Usage

1. Include the MyScroll.js file.

2. new MyScroll()

Parameters:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
new MyScroll({
"showBar": true, // Whether to display the progress bar
"color": "rgb(10, 116, 218)", // Progress bar color
"height": "3px", // Progress bar height
"debug": false, // Debug mode
"event": [
{
"height": "100%", // Trigger threshold. Supports pixels and percentages.
"loop": true, // Whether to enable looping. true/false. When set to false, the instance is destroyed after executing once.
"type": "up-down", // Trigger mode. Supports three modes: up-down, down-up, and all.
"func": function () {
alert('I have reached the bottom')
} // Method to execute after the trigger
},{
"el": "#testimg", // Supports selector strings or native DOM elements
"loop": false,
"height": "200px", // Positive value: Triggers the event after the specified element appears and scrolls downward by the corresponding distance. Negative values work in the opposite direction.
"func": function () {
document.querySelector("#testimg").classList = ['animation1'];
}
}
]
});
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare