Confirm In Place

A jQuery plugin that makes action confirmation unobtrusive and convenient. Instead of displaying an alert box, ConfirmInPlace puts the "OK"/"Cancel" links right at the user's cursor.

EXAMPLE

Hover and click this link:    Do The Thing

USAGE

Include the following files:

  • jQuery
  • confirmInPlace.min.js
  • confirmInPlace.css

Insert this markup into your page:

Do The Thing

...and run this script:

$(document).ready(function(){
	$("#your_id").confirmInPlace();
});

...or with options:

$(document).ready(function(){
	$("#your_id").confirmInPlace( {
		confirmTimeout: 500 // (default: 1000; the amount of time before the confirmation fades out if you don't click)
		, label: {
			ok: 'Puppies',
			cancel: 'Kittens',
			confirm: 'Pick one:'
		}
		, clicked: function(_s){
			// the callback function. Returns 'ok' or 'cancel', regardless of the link text
			function(_s){
				alert(`You clicked '${_s}'`);
			}
		}
	});
});

This plugin is free to use for any purpose: if you find it beneficial, a donation would be much appreciated. $10 isn't too much to ask for saving you hours of time, is it? Thank you so much!

Download Confirm In Place (zip file.)