bootstrap-modal-methods

1.0.1 • Public • Published

Methods for responsive Popup with Bootstrap 5. Show, hide / close or toggle a modal with JavaScript or via data attributes.

The modal plugin toggles your hidden content on demand, via JavaScript or data attributes

In order to fully use the methods described below, please make sure to read the API tab in our main Modals documentation. This helper page will simply provide you with some examples of most common JavaScript methods for Bootstrap modals.

Bootstrap Modal Methods

Check out Bootstrap Modal Methods Documentation for detailed instructions & even more examples.

Modal Show

const myModalEl = document.getElementById('myModal')
const modal = new mdb.Modal(myModalEl)
modal.show()

Modal Close / Hide

const myModalEl = document.getElementById('myModal')
const modal = new mdb.Modal(myModalEl)
modal.hide()

Modal Toggle

const myModalEl = document.getElementById('myModal')
const modal = new mdb.Modal(myModalEl)
modal.toggle()

How to use?

  1. Download MDB 5 - free UI KIT

  2. Choose your favourite customized component and click on the image

  3. Copy & paste the code into your MDB project

▶️ Subscribe to YouTube channel for web development tutorials & resources


More extended Bootstrap documentation

Package Sidebar

Install

npm i bootstrap-modal-methods

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

5.91 MB

Total Files

354

Last publish

Collaborators

  • mdbootstrap