Tibor Szász30 years old code addict

  • Home
  • About me
  • Projects
  • Contact me
  • RSS
  • Magyarul

2011 1205

Exploiting MooTools transitions

Exploiting MooTools transitions There is a nice class embedded in the MooTools core package, the Fx.Transitions. It is used to spice up the default animations in many different way. I won't go into details, there is a cool breakdown about the capabilities of the class.
I'd like to show you how you can pick any transition function and use them outside the Fx classes.
This approach can be handy if you need to trigger other functions or to work with the Canvas element, maybe update some non standard CSS properties.


The one line below returns a function that contains the easing equation.

Fx.Transitions.Circ.easeOut
To access the power of the Transitions functions, you need to pass a value, computed by the following formula:
CURRENT FRAME / MAX FRAMES

The transition class is intended to be used as a frame based helper tool. It expects 0 to 1 values. To convert back the returned values, just multiply them with 100. For example if you are creating a 50 step animation this is the way to go:
// x is the current frame
var val = Fx.Transitions.Circ.easeOut( x / 50 ) * 100;

Here is a small demonstration on JsFiddle.


Comments


Add new comment


Your name
Email
Your avatar
Website
Comment

Briefing

Me myself and I
I love coding, especially for the web. I'm in the online industry for 6 years. My favourite toys are:
JavaScript, PHP, XHTML, MySQL, Canvas, Flash

My startup

The project's name is CloudDeck and you can read about it here in more detail.

Topics

  • Coffee break
  • Design & stuff
  • Generative arts
  • Programming
  • User experience

Friends

  • Kárpáti Róbert
  • Royaljerry
  • Bagi Zoltán
  • Pegazoo
  • Charles Alexander Deli
  • Bence Bangócs
  • Lunakid
  • Rapp design

Feeling so social

  • Facebook
  • IWIW
  • TurulMeme

Tags

javascript (14) php (6) mootools (5) codeigniter (4) iscaffold (4) tutorial (3) crud (3) structure-synth (2) template (2) css (2) free (2) renders (2) google (2) experience (1) design, (1) user (1) iscaffold, (1) facebook (1) twitter (1) interface (1) canvas (1) drupal (1) wordpress (1) joomla (1) data-visualisation (1) resizing (1) cms (1) soundcloud (1) beatfader (1) combinator (1) magyar (1) windows8 (1) microsoft (1) clouddeck (1) ux (1) navigation (1) progress (1) transitions (1) reason (1) email (1) music (1) ie8 (1) bugs (1) bermuda-triangle (1) easing (1) clouddeck, (1) rc1 (1) bugfix (1) slimbox (1) tagging (1) cfdg (1) experiment (1) drag-and-drop (1) svg (1) blackout (1) firefox-extension (1) class (1) library (1) sitebuild (1) utf8 (1) nl2br (1) slideshow (1) wikipedia (1) dns (1) open-source (1) infovis (1) table (1) hack (1) script (1) google-buzz (1) forge (1) data-uri (1) inspiration (1) lists (1) ajax (1) konami-codes (1) trick (1) tabs (1) rss (1)




All rights reserved, ©2008-2013 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1