我原本,jQuery的動畫功能
targetWater.animate({
"width": "+=100%"
現在我要動態地使用「寬度」或「高度」
var direction = (targetWater.hasClass('x'))? "width" : "height";
targetWater.animate({
direction: "+=100%"
但這不起作用。
我已經試過
direction.toString()
和
''+direction+''
沒有喜悅與此兩種
var anim = { direction: "+=100%" }
targetWater.animate(anim,
+1,所有的答案都是正確的,這是一個很好的格式和解釋。 – jbabey
非常感謝你 – Titan