seamless-scroll-polyfill
Smooth Scroll behavior polyfill
Last updated 3 years ago by magic-akari .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install seamless-scroll-polyfill 
SYNC missed versions from official npm registry.

Build Status

This repo is forked from iamdustan/smoothscroll and rewritten with TypeScript.

Installation and use

# npm
npm install seamless-scroll-polyfill --save

# yarn
yarn add seamless-scroll-polyfill

Use polyfill to patch all methods

import { polyfill } from "seamless-scroll-polyfill";

polyfill();

Use specific polyfill

import { elementScrollIntoViewPolyfill } from "seamless-scroll-polyfill";

elementScrollIntoViewPolyfill();

Use methods directly without patching

import { scrollIntoView } from "seamless-scroll-polyfill";

scrollIntoView(document.querySelector("#target"), { behavior: "smooth", block: "center", inline: "center" });

Import via script

<!-- please replace the `latest` with specific version -->
<script src="https://cdn.jsdelivr.net/npm/seamless-scroll-polyfill@latest"></script>
<script>
    // patch all methods
    seamless.polyfill();
    // or use specific methods
    seamless.scrollBy(window, { behavior: "smooth", top: 200, left: 0 });

    seamless.scrollIntoView(document.querySelector("#target"), {
        behavior: "smooth",
        block: "center",
        inline: "center",
    });
</script>

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Thanks

Current Tags

  • 2.3.4                                ...           latest (3 years ago)
  • 2.1.1                                ...           next (5 years ago)

55 Versions

  • 2.3.4                                ...           3 years ago
  • 2.3.3 [deprecated]           ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.8                                ...           4 years ago
  • 2.1.7                                ...           4 years ago
  • 2.1.6                                ...           4 years ago
  • 2.1.5                                ...           4 years ago
  • 2.1.4                                ...           5 years ago
  • 2.1.3 [deprecated]           ...           5 years ago
  • 2.1.3-beta.3 [deprecated]           ...           5 years ago
  • 2.1.3-beta.2 [deprecated]           ...           5 years ago
  • 2.1.3-beta.1 [deprecated]           ...           5 years ago
  • 2.1.2 [deprecated]           ...           5 years ago
  • 2.1.1 [deprecated]           ...           5 years ago
  • 2.1.0 [deprecated]           ...           5 years ago
  • 2.0.2 [deprecated]           ...           5 years ago
  • 2.0.1 [deprecated]           ...           5 years ago
  • 2.0.0 [deprecated]           ...           5 years ago
  • 2.0.0-beta.1 [deprecated]           ...           5 years ago
  • 2.0.0-alpha.1 [deprecated]           ...           5 years ago
  • 1.2.4                                ...           5 years ago
  • 1.2.3                                ...           6 years ago
  • 1.2.2 [deprecated]           ...           6 years ago
  • 1.2.1 [deprecated]           ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.10                                ...           6 years ago
  • 1.0.9                                ...           6 years ago
  • 1.0.8                                ...           6 years ago
  • 1.0.7 [deprecated]           ...           6 years ago
  • 1.0.6 [deprecated]           ...           7 years ago
  • 1.0.5 [deprecated]           ...           7 years ago
  • 1.0.4 [deprecated]           ...           7 years ago
  • 1.0.3 [deprecated]           ...           7 years ago
  • 1.0.2 [deprecated]           ...           7 years ago
  • 1.0.1 [deprecated]           ...           7 years ago
  • 1.0.0 [deprecated]           ...           7 years ago
  • 0.5.9                                ...           7 years ago
  • 0.5.8                                ...           7 years ago
  • 0.5.7                                ...           7 years ago
  • 0.5.6                                ...           7 years ago
  • 0.5.5                                ...           7 years ago
  • 0.5.4                                ...           7 years ago
  • 0.5.3                                ...           8 years ago
  • 0.5.2                                ...           8 years ago
  • 0.5.1                                ...           8 years ago
  • 0.5.0                                ...           8 years ago
  • 0.4.5                                ...           8 years ago
  • 0.4.4                                ...           8 years ago
  • 0.4.3                                ...           8 years ago
  • 0.4.2                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 46
Last Month 55
Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |