How animate is used: Animate (Params,speed,callback);
Example: Animate ({right: "-=600px", Height: "+=400px"}, "slow", function () {$ (this). CSS ("Border", "5px Solid Red")});
where right and left , height change, width change.
+ = indicates the current position to left/right or add height/width to xx pixels. "Slow" means speed, and it can make its own time, 3000 means 3000 milliseconds.
The last one is to return the function, which represents the action to take after the animation is finished.
Example code, a div box with an ID of block, moves it to the right by 600px, and increases the height by 400px.
<!DOCTYPE HTML><HTMLLang= "en"xmlns= "http://www.w3.org/1999/xhtml"><Head> <MetaCharSet= "Utf-8" /> <Scriptsrc= "Jquery-1.3.2.min.js"></Script> <Linkhref= "Style.css"rel= "stylesheet"type= "Text/css" /> <Script>$ (document). Ready (function () { $("#block"). Click (function () { $( This). Animate ({right:"-=600px", Height:"+=400px" }, "Slow", function () { $( This). CSS ("Border","5px Solid Red")}); }); }); </Script> <style>#block{Margin-left:500px;Height:300px;width:300px;position:Absolute;Background-color:Blue; } </style> <title></title></Head><Body> <DivID= "Block"></Div></Body></HTML>
Custom Animation Methods Animate