我有三个HTML div的JavaScript,mm
,ss
和pp
。这三个字段相互动画...如果外部文件的内容发生更改,这些字段将在我的页面中更新。他们会更新动画。
如果mm
发生变化,则:
ss
隐藏,然后pp
隐藏,然后mm
隐藏,然后mm
显示,然后pp
显示,然后ss
显示,然后如果mm
没有变化,但pp
没变,那么:
ss
隐藏,然后pp
隐藏,然后pp
显示,然后ss
显示,然后如果mm
和pp
没有改变,但ss
没改变,那么:
ss
隐藏,然后ss
显示,然后我运行了这段代码,但它非常麻烦,我想知道是否有更好的方法来做我正在做的事情:
if ($('#mm').html() != mm) {
hideElem('.score');
setTimeout(function() {
hideElem('.player');
setTimeout(function() {
hideElem('.match');
setTimeout(function() {
updateElems();
setTimeout(function() {
showElem('.match');
setTimeout(function() {
showElem('.player');
setTimeout(function() {
showElem('.score');
}, inSpeed);
}, inSpeed);
}, outSpeed);
}, outSpeed);
}, outSpeed);
}, outSpeed);
} else if ($('#pp').html() != pp) {
hideElem('.score');
setTimeout(function() {
hideElem('.player');
setTimeout(function() {
updateElems();
setTimeout(function() {
showElem('.player');
setTimeout(function() {
showElem('.score');
}, inSpeed);
}, outSpeed);
}, outSpeed);
}, outSpeed);
} else if ($('#ss').html() != ss) {
hideElem('.score');
setTimeout(function() {
updateElems();
setTimeout(function() {
showElem('.score');
}, outSpeed);
}, outSpeed);
}
setTimeouts的原因是因为所有动画。
答案 0 :(得分:5)
您的代码可能如下所示:
Unresolved error Error Domain=NSCocoaErrorDomain Code=134020 "The model configuration used to open the store is incompatible with the one that was used to create the store." UserInfo={problemObject=<Order: 0x1702a5a00> (entity: Order; id: 0x170431980 <x-coredata:///Order/t38B0CF1D-437E-44AE-B833-D10B5AD584535> ; data: {
collection = "0xd000000000040004 <x-coredata://D29044CF-B9FB-4D26-9FB3-96FFEE919BD0/Collection/p1>";
displayOrder = 9999;
filterUser = "0xd000000000100008 <x-coredata://22E973D7-62F3-4F8F-B85B-CF12DFB8EFD7/FilterUser/p4>";
quantity = 1;
size = 1;
}), NSUnderlyingException=Can't resolve how to assign objects to stores; some objects may have been assigned to stores; use [[managedObject objectID] persistentStore] to find out what is going where now; use [managedObjectContext assignObject:toStore:] to straighten things out}, [AnyHashable("problemObject"): <Order: 0x1702a5a00> (entity: Order; id: 0x170431980 <x-coredata:///Order/t38B0CF1D-437E-44AE-B833-D10B5AD5845
Edge旁边的任何浏览器(以及带标志的Chrome)都不支持async / await,因此您必须使用async/await来编译代码。