Helium-Modal

Helium-modal is a jQuery modal window script, developed by Harun Eggleton under the open source MIT licence.

download latest release

Features:

Examples:

open modal #1 open modal #1 again open modal #2

Usage:

1: include required files

include the following scripts as follows before the end of the BODY tag

↓ select all

2: Add required HTML

add the following customizable modal template after your opening BODY tag

↓ select all

use the data-mid custom attribute on any link that you wish to trigger your modal

↓ select all

3: Add CSS

Add the following CSS in main.css (or any desired css location)

↓ select all

...or SASS

Here it is in SASS format

↓ select all

4: initialize

Place the follow before the end of the BODY tag to initialize all modals

↓ select all

Alternatives: "I want an additional close or cancel button in my modal"

just use the "close" class on any element in your modal that should act as a close link. Like so…

↓ select all

Alternatives: "I want to open or close my modal via javascript"

use the following jQuery inside any event

↓ select all

Alternatives: "I want to initialize my modals separately"

If you want a different initialization for each modal just remove the "each" wrapper from the initialization script like so…

↓ select all