Skip to content

Instantly share code, notes, and snippets.

@ipolevoy
Created September 17, 2015 04:05
Show Gist options
  • Save ipolevoy/9dc5955d17cd42d805da to your computer and use it in GitHub Desktop.
Save ipolevoy/9dc5955d17cd42d805da to your computer and use it in GitHub Desktop.
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="//code.jquery.com/jquery-2.1.1.js"></script>
<script src="http://lipis.github.io/bootstrap-sweetalert/lib/sweet-alert.js"></script>
<link rel="stylesheet" href="http://lipis.github.io/bootstrap-sweetalert/lib/sweet-alert.css">
<button class="sweet-4" >Try It</button>
<script type="application/javascript">
document.querySelector('.sweet-4').onclick = function(){
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
animation : 'slide-from-bottom',
showCancelButton: true,
confirmButtonClass: 'btn-danger',
confirmButtonText: 'Yes, delete it!',
closeOnConfirm: false,
//closeOnCancel: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted!", "success");
});
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment