Skip to content

datacutter/The-popup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bopup

Component to create a popup:

♦ suitable for

  • Pop-up forms
  • Privacy Policy
  • pop-up gallerys

Install from NPM.

npm i bopup

Import js

import Bopup from "../../node_modules/bopup/dist/js/bopup.js";

Import css

@import '../../node_modules/bopup/dist/css/bopup.css';

Add bopup HTML Layout

<div class="bopup bopup_form">
  <!-- close-button -->
  <div class="bopup-close-button"></div>
  <!-- popup inner -->
  <div class="bopup-content-wrapper">
    <!-- content -->
  </div>
</div>

Several popups

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.

Example
<button class="btn">callback form</button>
<span class="btn">callback form</span>
<div class="btn">callback form</div>

Initialize bopup

Finally, we need to initialize bopup in JS:

let popupForm = new Bopup(
  document.querySelector('.btn'),
  document.querySelector('.bopup_form')
)

css

 .bopup-content-wrapper {
   background: #fff;
  }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.6%
  • SCSS 22.1%
  • HTML 11.3%