<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="build/toastr.min.css" />
</head>
<body>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="build/toastr.min.js"></script>
<script>
$(function() {
success_prompt_alert()
})
function success_prompt_alert(content) {
toastr.options = {
closeButton: false,
debug: false,
progressBar: false,
positionClass: 'toast-top-center',
onclick: null,
showDuration: '300',
hideDuration: '1000',
// timeOut: "1000",
extendedTimeOut: '1000',
showEasing: 'swing',
hideEasing: 'linear',
showMethod: 'fadeIn',
hideMethod: 'fadeOut'
}
if (content == null) {
content = ''
}
var len = content.length
if (len <= 10 && len > 0) {
toastr.options.timeOut = '1800'
} else if (len <= 20) {
toastr.options.timeOut = '2800'
} else if (len <= 30) {
toastr.options.timeOut = '3800'
} else if (len > 30) {
toastr.options.timeOut = '4800'
}
toastr.success(content)
}
</script>
</body>
</html>