Get new jQuery plugins just once a week

×

PopConfirm

FavoriteLoadingAdd to favorites

February 4, 2015

PopConfirm | jQuery plugin based on Twitter Bootstrap Popover

PopConfirm is a simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover

Created by Favre Anael

Download

Example

PopConfirm jQuery plugin

popover

popconfirm

Compatible Bootstrap 2.3 and Bootstrap 3

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover

Example

Please, check our simple example here : http://jsfiddle.net/RDh7E/28/

How to use

1: Add the jquery.popconfirm.js file into your Twitter Bootstrap document including jQuery.

  <script type="text/javascript" src="js/jquery.popconfirm.js"></script>

2: Use the jQuery method popConfirm() on any object you want with handle click events :

<a href="mypage.html" id="link">link</a>
$("#link").popConfirm();
<button class="btn btn-success" data-toggle='confirmation' id="button">button</button>
$('#button').click(function() {
    alert('You clicked, and valided this button !');
});

$("#button").popConfirm();

Full options usage

$("[data-toggle='confirmation']").popConfirm({
        title: "Really ?", // The title of the confirm
        content: "I have warned you !", // The message of the confirm
        placement: "bottom", // The placement of the confirm (Top, Right, Bottom, Left)
        container: "body", // The html container
        yesBtn: "Yeah",
        noBtn: "Oh no !!!"
});

You can also pass parameters using the html attribute : data-confirm-* (replace * by the option name).

Example :

<a href="destination.html" data-confirm-title="My Super Title" data-confirm-content="My Super Question">Link</a>

What it handles

PopConfirm

Related posts:

Tabby
End Credits
Columns
PopConfirm jQuery plugin

http://jquer.in/wp-content/uploads/2015/02/PopConfirm.jpg

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever