以下是 jquery删除确认提示信息框js代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery确认提示信息框插件jconfirmaction</title>
<link rel="stylesheet" type="text/css" media="screen, projection" href="demo.css" />
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jconfirmaction.jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.ask-plain').click(function(e) {
e.preventDefault();
thisHref = $(this).attr('href');
if(confirm('Are you sure')) {
window.location = thisHref;
}
});
$('.ask-custom').jConfirmAction({question : "Anda Yakin?", yesAnswer : "Ya", cancelAnswer : "Tidak"});
$('.ask').jConfirmAction();
});
</script>
</head>
<body>
<span class="title">jConfirmAction Demo</span>
<br/><br/>
<div id="container">
<label>Without Plugin</label>
: <a href="delete.html" class="ask-plain">Delete Me</a>
<hr/>
<label>Using Plugin With Default Confirmation</label>
: <a href="delete.html" class="ask">Delete Me</a>
<hr/>
<label>Customized Language (Indonesian) </label>
: <a href="delete.html" class="ask-custom"><img src="images/trash.png" border="0" align="absbottom" /></a>
</div>
<br/>
</body>
</html>
CSS代码(demo.css):
*{margin:0;padding:0;}
body{text-align:center;font-family:Georgia,Serif;font-style:italic;font-size:19px;line-height:1.5em;margin-top:4%;background:#eaeaea;}
label{display:block;float:left;width:30em;}
hr{border:0;border-bottom:1px dotted #ccc;margin:1em 0;}
#container{text-align:left;width:700px;margin-left:auto;margin-right:auto;}
.question{position:absolute;display:inline;text-align:center;width:174px;height:78px;font-size:13px;line-height:1.5em;background:url('images/bubble.png') left top no-repeat;padding:10px 0 0 0;text-shadow:0px 1px 0px #fff;margin-left:-7em;margin-top:-6em;opacity:0;}
.yes,.cancel{margin-top:.5em;margin-right:.5em;cursor:pointer;display:inline-block;width:63px;height:21px;color:#fff;text-shadow:0px 1px 0px #000;background:url('images/button.png') left top no-repeat;}
.title{font-size:30px;margin-bottom:1.5em;font-weight:bold;font-style:italic;text-shadow:0px 2px 0px #fff;}
a,a:visited,a:hover{text-decoration:none;color:#000;}