DimitarChristoff / Modal

Modal Window and Bootstrap for mootools
http://jsfiddle.net/dimitar/GGAa5/
4 stars 2 forks source link

Modal BootStrap

Screenshot

A MooTools 1.4+ plugin that allows easy modal window use through HTML5 Boot-Strapping via data- properties on elements. Provides:

Screenshot

Screenshot 1

How to use

Download and check the Demo/index.html

Opening a modal can be as simple as adding this:


    new Modal.BootStrap(document.body);

    <a href="#simonSays" class="modal-overlay" data-title="Simon was here">Load contents of id=simonSays into a modal</a>`

Of course, you can open a modal window by pure javascript without the BootStrap:


    new Modal.Base(document.body, {
        header: "Hi",
        body: "loading something"
    });

Examples

http://jsfiddle.net/dimitar/GGAa5/ or The official Demo page as per package

Changelog

Public methods and options of Modal.Base

Keep in mind it will prefer CSS3 transitions, if they are available - instead of Fx.Morph (as fallback).

Check the Modal.js for all options, they are mostly self-explanatory.

Events in Modal.Base

Data properties and options for Modal.BootStrap

These are the properties on the trigger elements it can read:

From the Options object:

Since 1.04, Modal.BootStrap now supports hashtag URI to target a particular modal you have link behavior for.

example.com/signup#tnc will automatically try to find a.modal-overlay[href=#tnc] and click it to open it.