Sign inSign up

myScroll Native Scrollbar Plugin (Original)

Add-ons
2026-07-25 23:11 5 views • 0 downloads 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'];
}
}
]
});