Skip to content

jqueryscript/simplemodal-jquery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modal - A simple modal window

A simple jQuery plugin for creating draggable alert & confirm dialog boxes and image/video/AJAX modal windows.

When designing a site, you often want to display different kinds of messages or ask the visitor for specific information. With this plugin you can do just that.

You can create any kind of alert or confirmation dialog or even present your visitors with an image, a video, or an external page as a modal window without refreshing the page. This makes it easy to add things like newsletter, registration, or purchase forms.

Here is a nice demo.

How to Use

Minimal configuration

ALERT INTEGRATION

Snippet code Javascript:

	$("#myElement").click(function() {
	      $.fn.SimpleModal({
                btnOk:    "Alert button",
                title:    "Title",
	            contents: "Your message..."
	      }).showModal();
	});

Snippet code HTML:

	<a id="myElement" href="javascript;">Alert</a>

MODAL-AJAX INTEGRATION

Snippet code Javascript:

	$("#myElement").click(function() {
        $.fn.SimpleModal({
            model: "modal-ajax",
            title: "Title",
            param: {
                url: "file-content.php",
                onRequestComplete: function() { /* Action on request complete */ }
            }
        }.addButton("Action button", "btn primary", function() {
            this.hide();
        }).addButton("Cancel", "btn").showModal();
	});

Snippet code HTML:

	<a id="myElement" href="javascript;">Open Modal</a>

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.2%
  • Less 25.0%
  • CSS 24.8%