【发布时间】:2015-06-06 15:44:18
【问题描述】:
我有以下代码:
<script>
$(function () {
Command: toastr["success"]("My name is Inigo Montoya. You killed my father. Prepare to die!")
});
</script>
该框显示,但它是空白的,并且其中没有文本。我该如何解决?我尝试添加以下上述命令:
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-center",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
但它所做的只是使盒子居中。如何让文本出现?
【问题讨论】:
-
删除
Command:部分 -
谢谢,试过了,还是没有显示文字
-
你有什么错误吗?
-
无。如果我检查元素,控制台中不会显示任何内容。
-
如果你删除命令你的代码完全没问题,请确保你的代码在jquery和toastr.js加载后运行jsfiddle.net/noubazzs
标签: javascript jquery jquery-ui toastr