animation easing function

var baseEasings = {}; $.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(i, name) { baseEasings[name] = function(p) { return Math.pow(p, i + 2); }; }); $.each(baseEasings, function(name, easeIn) { $.easing["easeInOut" + name] = function(p) { return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2; }; });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.