语法:
hide()隐藏 show()隐藏
$(selector).animate(styles,speed,easing,callback)
案例:
//掉落¥
<style>
*{
margin: 0;
padding:0;
}
html,body{
width: 100%;
height: 100%;
}
#box{
width: 100%;
height: 100%;
background-color: #000;
position: relative;
}
span{
position: absolute;
}
</style>
</head>
<script src="./jquery.js"></script>
<body>
<div id="box">
</div>
<script>
function money(){
var $span=$("<span>阳阳 </span>")
var left = Math.random()*1200;//随机生成
$span.css({
"color":"red",
"font-Size":"30px",
"top":"0",
"left":left +"px"
})
$("#box").append($span);//添加节点
$span.animate({//jq动画
"top":"700px",//位置
"left":"left"
},1000,function(){
$(this).remove();//移出
})
}
setInterval(money,1000)
</script>