♦ 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';<div class="bopup bopup_form">
<!-- close-button -->
<div class="bopup-close-button"></div>
<!-- popup inner -->
<div class="bopup-content-wrapper">
<!-- 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">callback form</button><span class="btn">callback form</span><div class="btn">callback form</div>Finally, we need to initialize bopup in JS:
let popupForm = new Bopup(
document.querySelector('.btn'),
document.querySelector('.bopup_form')
) .bopup-content-wrapper {
background: #fff;
}