Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在这段代码中。
我的“changeOrb”部分有问题,因为“手动”执行相同的步骤会产生正确的输出。
换句话说,如果我清除Orb,那么drawOrb 作为两个步骤起作用,但是changeStatus 函数会在同一个div 中导致两个'Orbs'。
这不是不起作用的.remove()功能,而是您处理变量child1和child2.
.remove()
child1
child2
我改变了一点流程,它可以工作。请看一看
http://jsfiddle.net/BjMzH/25/