darkness

1.2.1 • Public • Published

Unscrollable modal background placeholder that can be used as modal background or for mobile menu background / flying carts etc. Simply prevents scrolling when menu or some modal is opened. Contains fix for jumping content caused by removing scrollbar with mouse plugged in.

Contains darkness.css with default styling.

Works IE9+ (uses classList. with polyfill probly lower). You can use it with AMD, CommonJS, ecma6...

Works this way: init the plugin by calling Darkness.iCallThy(). open darkness by calling Darkness.summon() close darkness by calling Darkness.dismiss() - if any class in body ends with -is-opened, close wont happen force close darkness by calling Darkness.begone()

Usage shown in index.html.

Readme

Keywords

none

Package Sidebar

Install

npm i darkness

Weekly Downloads

1

Version

1.2.1

License

MIT

Last publish

Collaborators

  • jxhx