【发布时间】:2012-05-19 20:41:14
【问题描述】:
我有这段代码:
$(this).css('color', 'red');
if(confirm('Do you want to delete this item?'))
window.location.href = link;
else
$(this).css('color', 'black');
但不幸的是 css('color', red) 在调用 confirm() 之前没有执行。如果我使用 animate 而不是 css,并在回调函数中执行 confirm(),它会在 before 动画实际完成之前执行。
请注意,这个问题不会出现在 chrome 中,它可以正常工作(对我而言)。
【问题讨论】: