Show Inline Content In A Modal – Ensemble Modal

Category: Javascript , Modal & Popup | April 30, 2021
Author: loltgt
Views Total: 52 views
Official Page: Go to website
Last Update: April 30, 2021
License: MIT

Preview:

Show Inline Content In A Modal – Ensemble Modal

Description:

A minimal JavaScript class that takes an element from the document and displays it in a modal popup.

How to use it:

1. Import the stylesheet ensemble-modal.css and JavaScript ensemble-modal.js into the document.

<link rel="stylesheet" href="./dist/css/ensemble-modal.css" />
<script src="./dist/js/ensemble-modal.min.js"></script>

2. This example shows how to display inline content in a modal popup.

<span class="content">Modal Content Here</span>
<button id="button-modal">Open In Modal</button>
const element = document.querySelector('.content');
const modal = new ensemble.Modal(element);
const button = document.getElementById('button-modal');
button.addEventListener('click', modal.open, true);

Changelog:

04/30/2021

  • Updates and bugfixes

You Might Be Interested In:


Leave a Reply