2.0.0 • Published 5 years ago
modal-bajs v2.0.0
📦 Modal BaJS
Installation
npm install notify-bajsUsage
import ModalBaJS from "modal-bajs";
const modal = ModalBaJS({
content: "<h1>Hello world</h1>"
});Methods
show()
Manually opens a modal
modal.show();hide()
Manually hides a modal
modal.hide();setContent()
modal.setContent("<b>New content here</b>");update()
Manually update options a modal
modal.update({
animation: "slideup",
maxWidth: 300,
closable: false
});Optional parameters
animation: (string) -popupsideup(default:popup)classContainer: (string) - Customized CSS classcontent: (string) - Content of the modalmask: (boolean) - Whether show mask or not (default:true)closable: (boolean) - Whether a close (x) button is visible on top right of the modal dialog or not (default:true)maskClosable: (boolean) - Whether to close the modal dialog when the mask (area outside the modal) is clicked (default:true)escClosable: (boolean) - Whether support pressescto close (default:true)maxWidth: (number) - Width of the modal dialog