Download
User Rating: 5/5 ( 1 votes)
popconfirm is a simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover
Source: github.com
1. INCLUDE CSS AND JS FILES
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="jquery.popconfirm.js"></script>
2. HTML
<a href="mypage.html" id="link">link</a>
3. JAVASCRIPT
$("#link").popConfirm();
4. OPTIONS
$("[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>