HTML
Copy codeThe Code is as follows:
<P> <a href = "#" class = "run"> Run </a> </p>
<Div id = "box">
</Div>
<P> <a href = "#" class = "run"> Run </a> </p> <div id = "box"> </div>
CSS
Copy codeThe Code is as follows:
<Style type = "text/css">
Body {}{
Margin: 20px auto;
Padding: 0;
Width: 580px;
Font: 80%/120% Arial, Helvetica, sans-serif;
}
A {}{
Font-weight: bold;
Color: #000000;
}
# Box {}{
Background: # 6699FF;
Height: 100px;
Width: 100px;
Position: relative;
}
</Style>
<Style type = "text/css"> body {}{ margin: 20px auto; padding: 0; width: 580px; font: 80%/120% Arial, Helvetica, sans-serif;} a {}{ font-weight: bold; color: #000000 ;}# box {}{ background: # 6699FF; height: 100px; width: 100px; position: relative ;}</style>
JavaScript
Copy codeThe Code is as follows:
$ (Document). ready (function (){
$ (". Run"). click (function (){
$ ("# Box"). animate ({opacity: "0.1", left: "+ = 400"}, 1200)
. Animate ({opacity: "0.4", top: "+ = 160", height: "20", width: "20"}, "slow ")
. Animate ({opacity: "1", left: "0", height: "100", width: "100"}, "slow ")
. Animate ({top: "0"}, "fast ")
. SlideUp ()
. SlideDown ("slow ")
Return false;
});
});
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-Type "content =" text/html; charset = gb2312 "/> <title> Chainable Transition Effects </title> <style type =" text/css "> body {margin: 20px auto; padding: 0; width: 580px; font: 80%/120% Arial, Helvetica, sans-serif;} a {font-weight: bold; color: #000000 ;}# box {background: # 6699FF; height: 100px; width: 100px; position: relative ;}</style> </pead> <body> <p> Run </p> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]