Implementing jQuery's shake effect with animate

前端 未结 9 2500
迷失自我
迷失自我 2020-12-14 10:38

I\'ve been given a cut down subset of the jQuery lib one of the key features I\'m missing is the .effect functions. I do however have .animate. I w

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 11:21

    It's actually already implemented this way under the covers, you can see exactly how in jquery.effects.shake.js, if you wanted to copy only that functionality you can.

    Another approach to think about: if you're using multiple effects, I'd recommend downloading jQuery UI with only the effects you want. For this effect, without copying the functionality yourself, you would just need jquery.effects.core.js and jquery.effects.shake.js.

提交回复
热议问题