tutorial 3: callback functions and responsive animations

watch it on YouTube

Definition

callback function
a function sent as a parameter in a method. A callback function is not executed until the other behavior of the method is complete.

Code Covered

animate
this method accepts css properties and corresponding values as strings in object format, a speed parameter ("slow", "fast", or numeric time in miliseconds [e.g. 2000]), and a callback function.
event.which
reserved keyword that returns a numeric value for the triggering event; if the event is a key press, it returns a unique value for each key on the keyboard. The code example on this page is an easy way to get the event.which value for different keys.