1.0.1 • Published 3 years ago

easy-modal-alert-box v1.0.1

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

Easy Modal / Alert Box

Easy Modal Box is a modern dialog library which is highly configurable, clear, simple and easily styleable works on mobile devices, and can be customized to match your style.

Generic Javascript plugin with different modal window appearances.

Overview

Check out the some following examples alert / modal box opening:

Technologies used: HTML5, Sass, Vanilla JS ES6.

Demo: Watch Online

Features

Responsive, Customizable and clean code

Include the files

<link href="easy-modal.min.css" rel="stylesheet">
<script src="easy-modal.min.js"></script>

Call the plugin when the body is load:

// Instantiate new modal

var modal = new SimplyModal({
      title: "Modal Box",
      content: "Modal Description",
      autoOpen: false,
      closeButton: true,
      type: "modal",
      className: ['fadein', 'slideRight', 'slideBottom', 'fall', 'flid3d', 'flid3dVertical', 'scale', 'folding', 'rotateLeft'],
      maxWidth: '',
      minWidth: '',
      overlay: true,
      setTimeOut: false,
      overlayClass: 'easy-modal-overlay',
      modalTypeClass: ['error', 'info', 'warn', 'succes'],
      closeText: 'X'

});
 modal.open();
}
NameTypeDefaultDescription
titlestringModal Box titleSet the your modal box title (optional). If yopu dont want title you can set '' string.
contentstringModal Box descriptionSet the your modal box description / spot (optional). If yopu dont want title you can set '' string.
autoOpenintegerfalseSet the automatic open immediately.
typestringmodalSet the template type ('modal' or 'alert' box)
closeButtonbooleantrueYou can set close button or not. If you dont want just change with false.
closeTextstringXIf you want you can change with any string ( Close, open, Yes or No )
maxWidth integer''Set maximum width of your box. Not requried.
minWidthinteger''Set minumum width of your box. Not requried.
overlaybooleantrueFor use overlay. If you dont want you can change with false.
setTimeoutintegerfalseSet the automatic close after millisecond.
overlayClassstringeasy-modal-overlayYou can change with your own class.
modalTypeClassarraydefaultFor which purpose you can choose it. 'error', 'info', 'warn', 'succes'.
className'fadein', 'slideRight', 'slideBottom', 'fall', 'flid3d', 'flid3dVertical', 'scale', 'folding', 'rotateLeft',

Css3 Effects

'fadein', 'slideRight', 'slideBottom', 'fall', 'flid3d', 'flid3dVertical', 'scale', 'folding', 'rotateLeft'

Author

  • Yasin Demir

License

This project is licensed under the MIT License - see the LICENSE.md file for details