1.5.0 • Published 10 years ago

dom-modal v1.5.0

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

dom-modal Dependency Status devDependency Status

Standalone modal for the browser.

  • CSS centered
  • No width or height needed. But it works if you provide them
  • Overlay included
  • Overlay click closes the modal
  • Esc key closes the modal
  • No external dependencies, all-in-one JavaScript file
  • ~3.5K minified gzipped
  • Easy to style
  • Works on IE9+

screenshot

npm install dom-modal --save

usage

var modal = require('dom-modal');
var content = document.createElement('div');
content.innerHTML = "Hello modal";

var myModal = modal(content);

myModal.show();
myModal.hide();

myModal.on('show', console.log);
myModal.on('hide', console.log);

test

npm test

example

npm run example

Then open http://0.0.0.0:8080/example.html in a browser.

styling

See the css files: overlay.css, modal.css.

Just overwrite the styles you want.

credits

CSS techniques by:

And modified by me for IE11.

1.5.0

10 years ago

1.4.0

10 years ago

1.3.3

10 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago