Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.
/ PopConfirm Public archive

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

License

Notifications You must be signed in to change notification settings

IfnotFr/PopConfirm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • jQuery .click() and .bind('click') methods
  • Hard coded onclick attributes
  • href attribute from a a lik
  • Submit a form from a type="submit" button/input

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published