Skip To Content

Smart Layer Popup Ver 1.1.0

Layer Popup Toggle Plugin

How To Use

Set the ID value of the popup
to be connected to the href or data-smartpop attribute.

Connected popup ID: #SMARTpop-1
Connected popup ID: #SMARTpop-3
<a href="#SMARTpop-1" class="your-class">...</a>
<button class="your-class" data-smartpop="#SMARTpop-2">...</button>
<div class="your-class" data-smartpop="#SMARTpop-3">...</div>

Get Started

  1. Add Markup

    <a href="#SMARTpop-1" class="your-class">...</a>
    <button class="your-class" data-smartpop="#SMARTpop-2">...</button>
    <div class="your-class" data-smartpop="#SMARTpop-3">...</div> <!-- not recommended -->
  2. Add JS

    <!-- Don't add my CDN in your project. I recommend adding it to your CDN -->
    <script src="https://cdn.jsdelivr.net/gh/fe-jw/SmartPop/SmartPop.min.js"></script>
  3. Initialize

    //Be sure to use querySelectorAll()
    document.querySelectorAll('.your-class').SmartPop({
    	popClose: 'your-close',	//Close button class name (default is btn-close)
    	cssModeClass: 'on'	//Popup none or block class name (if you do not write down the option, handle none/block with style property)
    });
View on Github