Simple Modal: Just another Window Modal – Powered by Mootools

Posted on October 10, 2011, under General, Graphics,  Bookmark it

SimpleModal is a Mootools plugin to create simple, yet professional-looking modal windows including alerts and confirm messages with only a few lines of code. Confirm configuration involves the use of callbacks to be applied to affirmative action; it can work in asynchronous mode and retrieve content from external pages or getting the inline content.

SIMPLEMODAL is not a lightbox although the possibility to hide parts of its layout may partially make it similar.

Content can also be retrieved via AJAX. Here’s an example below:

Snippet code Javascript:

#JS

$("myElement").addEvent("click", function(){
  var SM = new SimpleModal({"width":600});
      SM.addButton("Action button", "btn primary", function(){
          this.hide();
      });
      SM.addButton("Cancel", "btn");
      SM.show({
        "model":"modal-ajax",
        "title":"Title",
        "param":{
          "url":"file-content.php",
          "onRequestComplete": function(){ /* Action on request complete */ }
        }
      });
});

Snippet code HTML:

#HTML

Open Modal

Looking for something else?

Check the following premium web applications...

Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!

Get our RSS Feed!

Leave a Reply


* = required fields

  (will not be published)


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: If you want to post CODE Snippets, please make them postable first!
(e.g. <br /> should be converted to &lt;br /&gt;)