我通过拨打了一个toastr消息
Command: toastr["success"]("foo")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-bottom-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "2000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
似乎选项没有效果,timeOut
and和positionClass
没有被覆盖。
可能有人给我一个错误的信息?
我认为你应该在第一次调用toastr的方法之前改变选项(信息,成功等)
你应该更改你的jquery版本,如果1.2.3是你使用的版本,我建立了一个jsbin并测试它。只需尝试更新版本,例如“1.9.1”。如果你需要坚持1.2.3尝试另一个版本的toastr与jquery 1.2.3兼容。