jConfirm - jQuery Plugin

jQuery Confirmation Tooltips

jConfirm v.2 - Only 8kb (minified)

Want to confirm a delete but hate the default javascript confirm()? Say hello to jConfirm, the solution to all your woes.

Demo Get it on Github

Beautiful

Preview

Customizable:

  • CSS Design
  • Message Text
  • Button Labels
  • Callback
  • Element clicked returned to Callback

Example Code (actual code from demo above):

<!-- Includes the CSS -->
<link rel="stylesheet" type="text/css" href="jConfirm-v2.css">

<!-- Create buttons -->
<a href='#' class="btn btn-lg btn-success jConfirm" role="button" itemType='product' itemId='1'>Demo</a>
<a href='http://github.com' class="btn btn-lg btn-primary jConfirmTwo" role="button">Get it on Github</a>

<!-- Includes the jQuery and the JS -->
<script src='https://code.jquery.com/jquery-2.0.3.min.js'></script>
<script src='jConfirm-v2.js'></script>

<script>

<!-- Apply to all current + future elements with the class jConfirm (notice openNow) -->
$('body').on('click', '.jConfirm', function(){
	$(this).jConfirm({ 
		message: 'You sure you to delete this?', 
		confirm: 'YUPPERS', 
		cancel: 'NO WAY!', 
		openNow: this,
		callback: function(elem){ 
			alert('According to the link you clicked...\r\nType = "'+elem.attr('itemType')+'" \r\n ID = "'+elem.attr('itemId')+'"');
		} 
	}); 
});

<!-- Apply to all current elements with the class jConfirmTwo -->
$('.jConfirmTwo').jConfirm({ 
	message: "You sure you're ready to use our badass plugin?", 
	confirm: "Let's GO!", 
	cancel: "Sorry, I'm a Loser...", 
	openNow: false,
	callback: function(elem){
		window.location.href = elem.attr('href'); 
	} 
});

</script>
          

License (M.I.T)

Copyright (c) 2014 Versatility Werks
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.