css3 rotate transition, doesn't take shortest way
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use a css3 transition to smooth a compass movement using phonegap. i calculate the desired rotation as angle from 0 to 359. The problem is, when it should go from for example 359 to 0 it doesn't turn 1 degree clockwise, but instead it turns 359 degree counter clockwise. Is there a way to tell css to always take the shortest way for a rotation? 回答1: The transform is doing exactly what you tell it to. It starts at 359deg and goes to 1deg. You are looking to 'rollover' 360deg back to 1deg, which is really 361deg. The way the transform