an inline confirmation plugin based on jQuery
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
README.md

README.md

#iconfirm is an inline confirmation plugin based on jQuery#

Demo

http://neerajdotname.github.com/iconfirm

Usage

// using default options
$("a.delete").iconfirm();


 // using some custom options
 $("a.delete").iconfirm({
   okLabel: "Continue",
   cancelLabel: "Do not proceed",
   initCallback: function(elem) {
     elem.parent().fadeIn();
   }
 });

Configuration Options

msg             string    "Are you sure? "
okLabel         string    Label for proceed message (default: "Continue").
cancelLabel     string    Label for cancel message (default: "Cancel").
separator       string    Separator between the okLabel and cancelLabel (default: " | ").
timeout         integer   seconds before the confirmation dialogue closes automatically, 0 to 
                          disable this feature (default: 0).
initCallback    function  function that will be invoked when user clicks on the original link.
cleanupCallback function  function that will be invoked when user clicks on 'cancel' or the whole 
                          operation times out.
yesCallback     function  function that will be invoked when user clicks on 'continue'.

CSS

To display the inline confirmation message, a span html tag is created with class iconfirm. Use this class to properly decorate the confirmation message using css.

jQuery version

I have tested this plugin with jQuery 1.4.2 and 1.4.3 .

License

MIT

Copyright

Neeraj Singh ( neeraj@BigBinary.com )

TODO

  • write test
  • explain why return false is being used