A simple vanilla and lightweight modal which is easy to expand

Overview

Modal.js

A simple and lightweight modal.

Example

var m = new Modal({
    content: '

Hello World

', center: true }); m.beforeOpen = function() { console.log("I'm about to open!"); };

Options

Options can be set on each modal instance but global options can also be defined using the window.globalModalOptions which takes an object with the values displayed below.

All options are optional

Option Value
auto_open (Bool) Should the modal automaticly open
class (String) Extra class that will be added to the modal
close_button (Bool) Should the modal contain a close button
content (String) Content of the modal
center (Bool) If true, the modal will automaticly be centered
confirm_button (String) Text that will be displayed in the button. Leave empty if you don't want a confirm button
confirm_button_class_names (String) Class names that will be added to the confirm button

Lifecycle methods

Method Description
beforeOpen Called right before the modal will open
opened Called when the modal is completely visible
beforeClose Called right before the modal will close
closed Called when the modal has closed. Comes with an argument closed_via_confirm_button which is true when the modal is closed via the confirm button
You might also like...

Bootstrap-Lightbox - Simple & lightweight lightbox for Bootstrap 5

Bootstrap-Lightbox Simple & lightweight lightbox for Bootstrap 5 Basic Usage Adding data-modal="bs-lightbox" in your A href tag. a data-modal="bs-lig

Oct 11, 2022

A Lightweight Responsive jQuery Tooltip Plugin

tipso A Lightweight Responsive jQuery Tooltip Plugin There is also a Wordpress version of this plugin. Get it here Getting started Include jQuery scr

Dec 21, 2022

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

fancyBox jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable. See the project page for doc

Jan 2, 2023

Light and responsive lightbox script with focus on performance.

Magnific Popup Repository Fast, light and responsive lightbox plugin, for jQuery and Zepto.js. Documentation and getting started guide. Examples and p

Jan 2, 2023

Touch-friendly image lightbox for mobile and desktop

Touch-friendly image lightbox for mobile and desktop

Jan 5, 2023

Lightweight vanilla js modal component (just 2kb) , pure javascript Modal

Lightweight vanilla js modal component (just 2kb) pure javascript Modal , This is just 2kb Lightweight vanilla js modal component with zero dependenci

Dec 12, 2022

Expand and Collapse HTML content

Overview The Expander Plugin hides (collapses) a portion of an element's content and adds a "read more" link so that the text can be viewed by the use

Aug 15, 2022

Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian Plugin - Text Expander JS (open beta) This Obsidian plugin allows the user to type text shortcuts that are replaced by (or "expanded into") j

Dec 27, 2022

Simple to use modal / alert / dialog / popup. Created with vanilla JS. No javascript knowledge required! Works on every browser and device! IE9

Simple to use modal / alert / dialog / popup. Created with vanilla JS. No javascript knowledge required! Works on every browser and device! IE9

EinsModal The last modal / alert / dialog you will ever need! Full Documentation: https://www.einscms.com/modal EinsModal is the best solution to inte

Oct 20, 2022

Elegant, responsive, flexible and lightweight modal plugin with jQuery.

Elegant, responsive, flexible and lightweight modal plugin with jQuery.

iziModal Elegant, responsive, flexible and lightweight modal plugin with jQuery. izimodal.marcelodolza.com Fast Responsive Animated Lightweight Custom

Dec 30, 2022

A very lightweight and flexible accessible modal dialog script.

A11y Dialog This is a lightweight (1.3Kb) yet flexible script to create accessible dialog windows. Documentation ↗ Demo on CodeSandbox ↗ Features: Clo

Jan 2, 2023

jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.

jBox jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more. Demo: https://stephanwagner.

Dec 15, 2022

Accessible, lightweight, stylish modal library in pure JavaScript

accessible-minimodal Accessible, lightweight ( 8 kB), stylish modal library in pure JavaScript Example https://codepen.io/imhvost/pen/LYNazqo (with "

Aug 4, 2022

Lightweight and easy to use vanilla js library to add css animations to elements on scroll.

Scrollrisen Trigger css animations on scroll as elements enter the viewport. Zero dependencies, lightweight and easy to use and customize Installation

Oct 13, 2022

ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website.

⚡ ToastmeJS ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website. Customize positio

Jun 20, 2022

A Simple yet extendable jQuery modal script built for use with inline HTML, images, videos, and galleries.

jQuery Chaos Modal A Simple yet extendable jQuery modal script built for use with inline HTML, forms, and images in mind. There are many other modal p

Oct 8, 2020

Simple to use and manage modal.

vue-modal-provider nice-modal-react vue implementation. Simple to use and manage modal. benefit: Create modal without losing context No need to mainta

Nov 10, 2022

Jenesius vue modal is simple library for Vue 3 only

Jenesius Vue Modal Jenesius vue modal is simple library for Vue 3 only . Site Documentation Installation npm i jenesius-vue-modal For add modals in yo

Dec 30, 2022

Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices

Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices like: web, tablets, Mobile (IPad & IPhone). This plugin adapts the screen size and changes its action accordingly.

Dec 8, 2022
Owner
null
Elegant, responsive, flexible and lightweight modal plugin with jQuery.

iziModal Elegant, responsive, flexible and lightweight modal plugin with jQuery. izimodal.marcelodolza.com Fast Responsive Animated Lightweight Custom

Marcelo Dolza 2.1k Dec 30, 2022
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.

jBox jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more. Demo: https://stephanwagner.

Stephan Wagner 1.4k Dec 15, 2022
Extends the default Bootstrap Modal class. Responsive, stackable, ajax and more.

Note: Since this plugin was created to solve a lot of the issues with BS2, it still uses the BS2 markup syntax. Currently I believe the default BS3 mo

Jordan Schroter 5k Dec 28, 2022
Avgrund is jQuery plugin with new modal concept for popups

Avgrund Avgrund is a jQuery plugin for your modal boxes and popups. It uses new concept showing depth between popup and page. It works in all modern b

Dmitri Voronianski 1.8k Dec 14, 2022
A modal built with pure CSS, enhanced with JavaScript

CSS Modals Modals built out of pure CSS Please visit the website to read more about this project and refer to the FAQ in case of a question. What is i

Hans Christian Reinl 1.8k Dec 22, 2022
The simplest possible modal for jQuery

A simple & lightweight method of displaying modal windows with jQuery. For quick examples and demos, head to jquerymodal.com. Why another modal plugin

Kyle Fox 2.5k Dec 29, 2022
Toggle the state of a UI element to easily create components e.g. collapse, accordion, tabs, dropdown, dialog/modal.

Tiny UI Toggle Toggle the state of a UI element to easily create components e.g. collapse, accordion, tabs, dropdown, dialog/modal. Demo and documenta

Nigel O Toole 79 Dec 22, 2022
A modern dialog library which is highly configurable and easy to style. #hubspot-open-source

vex Demo Documentation vex is a modern dialog library which is highly configurable, easily stylable, and gets out of the way. You'll love vex because

HubSpot 6.9k Jan 5, 2023
A modern dialog library which is highly configurable and easy to style. #hubspot-open-source

vex Demo Documentation vex is a modern dialog library which is highly configurable, easily stylable, and gets out of the way. You'll love vex because

HubSpot 6.9k Apr 1, 2021
:zap: Simple and easy to use lightbox script written in pure JavaScript

baguetteBox.js Simple and easy to use lightbox script written in pure JavaScript. Demo page Table of contents Features Installation Importing Usage Cu

Marek Grzybek 2.3k Jan 3, 2023