Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isolate-scroll

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isolate-scroll

A small no-dependency Javascript lib for prevent browser to scroll parent container on wheel or touch event

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

AP Logo


Isolate Scroll

Version License

Introduction

Isolate Scroll is a small JavaScript library with no external dependency. Activating this library on an element, parents container will don't move when you scroll inside a child. This library prevent scroll on wheel and thouch event.

Browser Compatibility

Isolate Scroll supports all browsers that are [ES5-compliant] (http://kangax.github.io/compat-table/es5/) (IE8 and below are not supported).

Mobile support

Isolate Scroll also prevent parent scroll in mobile browsers.


Installing

With a package manager (recomanded):

npm install isolate-scroll --save 

Manually:
Download this library from https://github.com/AleeeKoi/isolate-scroll/releases


Basic usage

As ES6 module

import IsolateScroll from 'isolate-scroll';

var target = '.target-element';

// or:
// var target = document.querySelector('.target-element');

var isolateScrollInstance = new IsolateScroll(target);
Including directly as library
<script src="/path/to/isolateScroll.min.js"></script>

<script>
  (function(w) {

    w.addEventListener('load', function () {
      var isolateScrollInstance = IsolateScroll('.container');
    }, true);

  })(window);
</script>

DOM change/resize

On inizialization this library caches some values, if DOM changes or is resized you need to manually call following method:

isolateScrollInstance.update();

License

MIT

Copyright (c) 2019-present, Alessandro Pellizzari

Keywords

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc