🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Inline Affirm is a really small jQuery plugin that adds an inline confirmation box with YES / NO buttons to your call to action button using HTML5 data attributes.

confirmation-dialog confirm

Documentation

jQuery Inline Affirm

jQuery Inline Affirm gives you an inline call to action and confirmation without having to mess with dialogs. It includes 3 styles: button, dark and light but can be styled easily.

demo: http://ashcraig.com/jq-inline-affirm/

How to use

html : create a div element with the class "affirm" and style with "light", "dark" or "button" classes

EXAMPLE

<div class="affirm button" data-id="1111" data-title="Save" data-question="Save this document?"></div> 
  • data-id : a unique id for the created element
  • data-title : the title of the affirm link
  • data-question : the question to affirm
  • data-result : optional : text or html to display once affirmed

jQuery :

$(".affirm").inlineAffirm({ 	callback : function(ele){ 	console.log( $(ele).attr("data-id" )); 	} }); 

You May Also Like