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
I wrote some time ago a few simple jquery animations:
https://github.com/yckart/jquery-custom-animations
/**
* @param {number} times - The number of shakes
* @param {number} duration - The speed amount
* @param {string} easing - The easing method
* @param {function} complete - A callback function
*/
jQuery.fn.shake =
jQuery.fn.wiggle = function (times, duration, easing, complete) {
var self = this;
if (times > 0) {
this.animate({
marginLeft: times-- % 2 === 0 ? -15 : 15
}, duration, easing, function () {
self.wiggle(times, duration, easing, complete);
});
} else {
this.animate({
marginLeft: 0
}, duration, easing, function () {
if (jQuery.isFunction(complete)) {
complete();
}
});
}
return this;
};