Skip to content
Browse files

Merge pull request #5 from oallouch/master

'tweenCSS3' and 'morphCSS3' properties added to Element
  • Loading branch information...
2 parents d78f332 + 0069212 commit 849066c0b08093e00e3cc6d5d0b9723b900af9af @mcfedr committed
Showing with 46 additions and 0 deletions.
  1. +46 −0 Source/Fx.CSS3.js
View
46 Source/Fx.CSS3.js
@@ -433,4 +433,50 @@ provides: [Fx.Tween.CSS3, Fx.Morph.CSS3, Fx.Elements.CSS3]
}
+})();
+
+/**
+ * 'tweenCSS3' and 'morphCSS3' properties
+ */
+(function() {
+ Element.Properties.tweenCSS3 = {
+ set: function(options){
+ this.get('tweenCSS3').cancel().setOptions(options);
+ return this;
+ },
+ get: function(){
+ var tween = this.retrieve('tweenCSS3');
+ if (!tween){
+ tween = new Fx.Tween.CSS3(this, {link: 'cancel'});
+ this.store('tweenCSS3', tween);
+ }
+ return tween;
+ }
+ };
+
+ Element.Properties.morphCSS3 = {
+ set: function(options){
+ this.get('morphCSS3').cancel().setOptions(options);
+ return this;
+ },
+ get: function(){
+ var morph = this.retrieve('morphCSS3');
+ if (!morph){
+ morph = new Fx.Morph.CSS3(this, {link: 'cancel'});
+ this.store('morphCSS3', morph);
+ }
+ return morph;
+ }
+
+ };
+ Element.implement({
+ tweenCSS3: function(property, from, to){
+ this.get('tweenCSS3').start(property, from, to);
+ return this;
+ },
+ morphCSS3: function(props){
+ this.get('morphCSS3').start(props);
+ return this;
+ }
+ });
})();

0 comments on commit 849066c

Please sign in to comment.
Something went wrong with that request. Please try again.