Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/igorskyflyer/npm-scrollend-polyfill

๐Ÿ›ด A performant and light (< 1.5KB) JavaScript polyfill for the scrollend Event. โ›ธ๏ธ
https://github.com/igorskyflyer/npm-scrollend-polyfill

back-end biome browser dom element es6 event html igorskyflyer javascript js npm scroll-end scrollend scrollend-polyfill ts typescript

Last synced: 3 days ago
JSON representation

๐Ÿ›ด A performant and light (< 1.5KB) JavaScript polyfill for the scrollend Event. โ›ธ๏ธ

Awesome Lists containing this project

README

        

ScrollEnd polyfill



๐Ÿ›ด A performant and light (< 1.5KB) JavaScript polyfill for the scrollend Event. โ›ธ๏ธ




---





๐Ÿ’– Support further development


I work hard for every project, including this one and your support means a lot to me!


Consider buying me a coffee. โ˜•


Thank you for supporting my efforts! ๐Ÿ™๐Ÿ˜Š





Donate to igorskyflyer




@igorskyflyer










## ๐Ÿ“ƒ Table of contents

- [Usage](#-usage)
- [API](#-api)
- [CDN](#cdn)
- [Install](#package-install)
- [Examples](#-examples)
- [Changelog](#-changelog)
- [License](#-license)
- [Related](#-related)
- [Author](#-author)

---




## ๐Ÿ•ต๐Ÿผ Usage

You can import the file via the CDN or by installing the package.


### CDN


jsDelivr stats


The polyfill is hosted on jsDelivr and you can grab it from here:

[https://cdn.jsdelivr.net/gh/igorskyflyer/[email protected]/dist/scrollend.min.js](https://cdn.jsdelivr.net/gh/igorskyflyer/[email protected]/dist/scrollend.min.js)

then add it to your HTML file:


`index.html`
```html

```

---

### Package install

Install it by executing:

```shell
npm i "@igor.dvlpr/scrollend-polyfill"
```

Then import it into your project, e.g. an HTML page via the `` tag:

<br>

`index.html`
```html
<script src="./node_modules/@igor.dvlpr/scrollend-polyfill/dist/scrollend.min.js"
integrity="sha256-3fG8VnL6PFA7RyDVnkG5bk03GMi6Xvy1tIKkSMKJ+Ds=">
```

but if you don't like messing with that long path just copy the `"./node_modules/@igor.dvlpr/scrollend-polyfill/dist/scrollend.min.js"` file to a directory of your liking and then update the reference to it, i.e.

```html

```




> [!NOTE]
> If you use CSP (*which you really should)* you need to add the above SHA-256 hash to the allowed script sources.
>


## ๐Ÿคน๐Ÿผ API

This polyfill adds the `scrollend` Event for the `window` and `document` objects.

```js
window.addEventListener('scrollend', myHandler)
document.addEventListener('scrollend', myHandler)
```


The polyfilled `scrollend` Event can be added via `addEventListener()` or via the property `onscrollend`.

```js
window.onscrollend = myHandler
document.onscrollend = myHandler
```

---

## โœจ Examples

`scroll-end.html`
```html




Scrollend polyfill


body {
height: 180vh;
}




Launch the DevTools and open the Console tab.


Then start scrolling.





function test() {
console.log('Scroll ended')
}

document.addEventListener('scrollend', test)

```

---

## ๐Ÿ“ Changelog

โœจ Changelog is available here: [CHANGELOG.md](https://github.com/igorskyflyer/npm-scrollend-polyfill/blob/main/CHANGELOG.md).

---

## ๐Ÿชช License

Licensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-scrollend-polyfill/blob/main/LICENSE).

---

## ๐Ÿงฌ Related

[@igor.dvlpr/magic-queryselector](https://www.npmjs.com/package/@igor.dvlpr/magic-queryselector)

> _๐Ÿช„ A TypeScript-types patch for querySelector/querySelectorAll, make them return types you expect them to! ๐Ÿ”ฎ_


[@igor.dvlpr/aria](https://www.npmjs.com/package/@igor.dvlpr/aria)

> _๐Ÿงฌ Meet Aria, an efficient Adblock filter list compiler, with many features that make your maintenance of Adblock filter lists a breeze! ๐Ÿฆ–_


[@igor.dvlpr/windows-packages](https://www.npmjs.com/package/@igor.dvlpr/windows-packages)

> _๐Ÿ’ป A Node.js module for reading the Packages registry key on Windows 10+. Useful for retrieving Windows 10+ installed Store applications. ๐Ÿ“ฆ_


[@igor.dvlpr/encode-entities](https://www.npmjs.com/package/@igor.dvlpr/encode-entities)

> _๐Ÿƒโ€โ™‚๏ธ Fast and simple Map and RegExp based HTML entities encoder. ๐Ÿ_


[@igor.dvlpr/regkeys](https://www.npmjs.com/package/@igor.dvlpr/regkeys)

> _๐Ÿ“š An NPM package for fetching Windows registry keys. ๐Ÿ—_

---


### ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Author
Created by **Igor Dimitrijeviฤ‡** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).