Coder Social home page Coder Social logo

shujakhalid19 / slickscrolljs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from musab-hassan/slickscrolljs

0.0 0.0 0.0 2.42 MB

A Lightweight JavaScript library for quick and painless momentum & parallax scrolling effects.

Home Page: https://slickscroll.musabhassan.com

License: MIT License

JavaScript 0.94% TypeScript 99.06%

slickscrolljs's Introduction

Slickscroll is a JavaScript library that makes momentum & parallax scrolling quick and painless

NPM version NPM license

View Demo: slickscroll.musabhassan.com

Momentum Scrolling
Momentum Scrolling is the smooth and eased scrolling fancy websites have to allow the page to flow smoothly when scrolling.

Download & Setup

Download

Manually download from Releases, from the dist directory, or npm.

npm

npm install --save slickscrolljs

Setup

This setup will just apply momentum scrolling to the body

ES6 import

import slickScroll from './slickscroll.es.min.js';

const slick = new slickScroll({
    root: "body"
});

HTML script tag

<script src="./slickscroll.min.js" type="text/javascript"></script>

<script type="text/javascript">

    let slick = new slickScroll.default({
        root: "body"
    });

</script>

Node require

const slickScroll = require('slickscrolljs');

const slick = new slickScroll.default({
    root: "body"
});

Hello World

The hello world will apply the momentum scrolling to the element you specify.

slick.momentumScroll({
    root: "body"
})

The overflow property of the root element will be overridden with auto upon initialization of slickscroll. If you wish to change overflow to anything else, you must modify it after the initialization.

Momentum scrolling applies to both x and y axis of an element. If you wish for an axis to not scroll, change it's overflow value to hidden after slickscroll initialization.

Example to hide overflow-x after initializing up slickscroll;

const slick = new slickScroll.default({
    root: "body"
});

document.body.style.overflowX = "hidden";

All the valid options aswell as documentation and Getting Started can be found in the docs directory.

Browser Support

Browser Version
Chrome 61+
Edge 80+
IE 11
Firefox 48+
Opera 48+
Safari 12+

Contributors

Musab-Hassan

License

MIT license.

slickscrolljs's People

Contributors

musab-hassan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.