Skip to content

Instantly share code, notes, and snippets.

@NOEinteractive
Created November 25, 2013 10:51
Show Gist options
  • Save NOEinteractive/7639594 to your computer and use it in GitHub Desktop.
Save NOEinteractive/7639594 to your computer and use it in GitHub Desktop.
Remplacer rapidement $.animate par Tweenlite sur des animations existantes
//you need to load
//http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js
//http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js
if(window.TweenLite) { // smoother animation with TweenLite
$.fn.animate = function(params, duration, onComplete) {
if(onComplete) params.onComplete = onComplete;
TweenLite.to(this, duration/1000, params);
};
}
//@todo : $.stop() avec killAll je pense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment