Animate This tutorial requires the jquery
framework. Lets look into more on the animate function because its a very fun
function to play with. it changes the position of HTML elements and animates
until it the given property is set. So if we set the width to 500px of a div it
will span across in width till it hits the 500 mark set. <div id="box">Refresh the page</div> now add the CSS width: 138px; Here we are just going make a box
and set the shape and font. $(function(){ The
animate function works by passing the parameters we want to change so first
when the document object is ready we expand the width of the shape. Chain Functions This tutorial requires the jquery
framework. For this tutorial we will be looking into chaining functions
together with jquery so we will be seeing functions to go off one at a time.
This saves you writing different effects on different lines and combine them
into one line. <div id="box">Refresh the page</div> and add the CSS #box so we just make a basic box shape and now for the javascript $(function(){ Here we are only apply 3 effects but they are chained together and run one after another. Callback Functions This tutorial requires the jquery
framework. Callback is a way of javascript pointing to a new function after the
current function is complete. <p>This is some text that will fade out</p> and add the CSS p now for the javascript $(function(){ We pass in a second parameter for the fadeOut() function which is another function and side that is the alert statement so when the fade out is complete the callback function called which runs the alert message. |