An open API service indexing awesome lists of open source software.

https://github.com/mdbootstrap/bootstrap-modal-methods

Methods for responsive Popup with Bootstrap 5. Show, hide / close or toggle a modal with JavaScript or via data attributes.
https://github.com/mdbootstrap/bootstrap-modal-methods

bootstrap bootstrap5 methods modal modal-dialog modals

Last synced: about 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

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](https://mdbootstrap.com/img/Marketing/github/modal-methods/basic.png)

Check out [Bootstrap Modal Methods Documentation](https://mdbootstrap.com/docs/standard/extended/modal-methods/) for detailed instructions & even more examples.

## Modal Show

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

## Modal Close / Hide

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

## Modal Toggle

```javascript
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

[:arrow_forward: Subscribe to YouTube channel for web development tutorials & resources](https://www.youtube.com/MDBootstrap?sub_confirmation=1)

___

## More extended Bootstrap documentation