Custom Object calling Methods with setTimeout loses scope

后端 未结 3 1452
醉酒成梦
醉酒成梦 2020-12-09 21:10

I\'m having an issue with building a Javascript object, and calling methods within that object using setTimeout. I\'ve tried various workarounds, but always during the seco

3条回答
  •  一个人的身影
    2020-12-09 21:17

    This is jQuery, correct? There's a callback parameter to animate(); pass it the function you want called after the animation completes and jQuery will take care of calling it. The callback should capture the scope you want just fine.

提交回复
热议问题