jGrowl in a dialog
by A B
HTML
<link rel="stylesheet" href="http://stanlemon.net/stylesheet/jquery.jgrowl.css">
<script src="http://stanlemon.net/javascript/jquery.jgrowl.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css">
<div id="pop">click me</div>
<div id="dialog-confirm"></div>
JavaScript
$("#pop").click(function(){
$( "#dialog-confirm" ).dialog( "open" );
return false;
});
$( "#dialog-confirm" ).dialog({
autoOpen: false,
resizable: false,
height:200,
modal: true,
buttons: {
"Drop": function() {
//ajax
var checkbox = $("#repost").val();
// $( this ).dialog( "close" );
$.jGrowl('ACTION SUCCESSFUL!', {
life: 1000,
beforeClose: function(e,m) {
$( "#dialog-confirm" ).dialog( "close" );
}
});
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});