Minimal Responsive Modal Box Using Pure JavaScript – bp-modal.js

Category: Javascript , Modal & Popup | July 10, 2021
Views Total:162 views
Official Page:Go to website
Last Update:July 10, 2021


Minimal Responsive Modal Box Using Pure JavaScript – bp-modal.js


bp-modal.js is a small and simple-to-use JavaScript library that helps you display nice clean, responsive modal window on your web page.

How to use it:

Add the modal.min.css in the header for basic modal styles.

<link rel="stylesheet" href="modal.min.css">

Add the bp-modal.min.js script in your document, before the closing body tag.

<script src="bp-modal.min.js"></script>

Create a medium-sized modal window following the markup structure as shown below. This modal includes the class modal-closable which adds the fancy close button at the top right.

<div id="test" class="modal modal-medium modal-closeable">
  <div class="modal-header">
    <h2>Modal Header</h2>
  <div class="modal-content">
    <p>Modal Content</p>

You can launch the modal window using any element which has the corresponding data-modal value.

<p data-modal="test">Click me!</p>



  • Refactor

You Might Be Interested In:

Leave a Reply