Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript toaster.clear(';*';)在jQuery函数中不起作用_Javascript_Jquery_Message_Mouseover_Angular Toastr - Fatal编程技术网

Javascript toaster.clear(';*';)在jQuery函数中不起作用

Javascript toaster.clear(';*';)在jQuery函数中不起作用,javascript,jquery,message,mouseover,angular-toastr,Javascript,Jquery,Message,Mouseover,Angular Toastr,我用的是有角度的烤面包机信息。我使用toaster.clear('*')清除一条toaster消息并显示下一条toaster消息。这在我的其他情况下效果很好 然而,在这里它不起作用。我清除了前面的toaster消息并更改了toaster的文本,但只有当我将鼠标悬停在它上面时,消息才会更改 $(“#pageColorPallete”).change(函数(){ 如果($scope.questionNumber==1){ selectedcoler=$(“pageColorPallete”).spe

我用的是有角度的烤面包机信息。我使用
toaster.clear('*')
清除一条toaster消息并显示下一条toaster消息。这在我的其他情况下效果很好

然而,在这里它不起作用。我清除了前面的toaster消息并更改了toaster的文本,但只有当我将鼠标悬停在它上面时,消息才会更改

$(“#pageColorPallete”).change(函数(){
如果($scope.questionNumber==1){
selectedcoler=$(“pageColorPallete”).spectrum(“get”);
selectedhexacoler=selectedcoler.tohexaxstring();
烤面包机.透明('*');
var content=document.getElementById(“editableTextArea”);
content.style.backgroundColor=所选六色;
如果(selectedhexacoler=='#ffffff'){
如果($scope.truments<3){
$scope.addMarksGeneric($scope.activityThreeMarks,10);
}
烤面包机.透明('*');
烤面包机({
键入:“info”,
标题:“步骤2”,
正文:“第二步消息正文”,
烤面包机:2
});
$scope.questionNumber=$scope.questionNumber+1;
}否则{
$scope.debutctmarksgeneric($scope.activityThreeMarks,5);
烤面包机({
键入:“错误”,
标题:“再试一次”,
正文:“请再试一次。”,
烤面包机:2
});
}
}否则{
$scope.debutctmarksgeneric($scope.activityThreeMarks,5);
烤面包机({
键入:“错误”,
标题:“再试一次”,
正文:“请按照步骤继续。”,
烤面包机:2
});
}
});

奇怪的问题:您是否尝试使用
setTimeout(function(){…},)?试试看,所有代码都放在
var content=document.[…]
之后。尝试大超时(2-3秒),以防浏览器只需要一些时间或其他什么。这不是一个解决方案,只是一个测试。非常感谢,它很有效$超时(函数(){toaster.clear('*');toaster.pop({type:'info',title:'step 2',body:'body of step 2',toasterId:2});$scope.questionNumber=$scope.questionNumber+1;},1000);这其实很奇怪。如果
toaster.clear('*')在timeout.hmm内。是啊,我也不明白它在那里是怎么运作的。