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.
Minimal configuration
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>
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>