The example of this article for everyone to share the effect of JS sliding, for everyone to refer to, the specific content as follows
JS code Beautiful animation effect; in the upper right corner: The background color is red, the font color is white slide is big move slowly fade
function Tishi () {
$ ("#tishi"). attr ("style", "border:1px solid #000;p Osition:absolute; Z-index:10; width:200px; height:30px;color:white;background-color:red;border-radius:25px;-moz-border-radius:25px; text-align:center;left:70%; top:10%; Display:none ");
$ ("#tishi"). Show (). Animate ({
width: ' 300px ',
height: ' 37px ', top
: '-=10px '
, opacity: ' 0.8 '
}, " Slow ");
$ ("#tishi"). Show (). Animate ({top
: '-=10px '
, opacity: ' 0.6 '
}, "slow");
$ ("#tishi"). Show (). Animate ({top
: '-=10px '
, opacity: ' 0.4 '
}, "slow");
$ ("#tishi"). Show (). Animate ({top
: '-=10px '
, opacity: ' 0.2 '
}, "slow");
$ ("#tishi"). Show (). Animate ({top
: '-=10px '
, opacity: ' 0.0 '
}, "slow");
}
Front code, written in the body:
<div id= "Tishi" style= "border:1px solid #000;
Position:absolute; Z-index:10; width:200px;
Height:30px;color:white;
background-color:red;border-radius:25px;
-moz-border-radius:25px; * * Old Firefox * *
text-align:center;left:70%;
top:10%;
Display:none > Please improve the information </div>
I hope this article will help you learn about JavaScript programming.