https://dmitriy-line.github.io/bopup-demo/
♦ suitable for
- Pop-up forms
- Privacy Policy
- pop-up gallerys
npm i bopup
import bopup from "../../node_modules/bopup/dist/js/bopup.js";
@import '../../node_modules/bopup/dist/css/bopup.css';
<!-- popup container -->
<div class="bopup">
<!-- close-popup-button -->
<div class="bopup-close-button"></div>
<!-- popup wrapper -->
<div class="bopup-content-wrapper">
<!--popup content -->
<!-- any block or content -->
</div>
</div>
To create several popups, just add an extra class to the <div class="bopup">
,
for example <div class="bopup bopup_form">
Add any content in to the <div class="bopup-content-wrapper">
create element that will trigger the popup.
<button class="btn">button</button>
<span class="span">span</span>
<div class="div">div</div>
Finally, you need to initialize bopup in JS:
bopup(document.querySelector('.btn'), document.querySelector('.bopup'));
.bopup-content-wrapper {
background: #fff;
}