日期:2014-05-16 浏览次数:20370 次
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("input").click(function(){
$("span").animate({fontSize:"50px"},1000,function(){
$(this).animate({fontSize:"20px"},10000);
});
});
});
</script>
</head>
<body>
<input type="button" value="Start"><br/>
<span>H</span> <span>e</span> <span>l</span> <span>l</span> <span>o</span> <span>,</span> <span>W</span> <span>o</span> <span>r</span> <span>l</span> <span>d</span> <span>!</span>
</body>
</html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script>
<script type="text/javascript">
var i = 0;
var st;
$(document).ready(function(){
$("input").click(function(){
st = setInterval(sleep,2000);
})
});
function sleep(numberMillis) {
var span = $("span");
var len = $("span").length;
for(;i<len;){
$(span[i]).animate({fontSize:"50px"},1000,function(){
$(this).animate({fontSize:"20px"},10000);
});
i++
break;
}
if(i == len){
clearInterval(st);
}
}
</script>
</head>
<body>
<input type="button" value="Start"><br/>
<span>H</span> <span>e</span> <span>l</span> <span>l</span> <span>o</span> <span>,</span> <span>W</span> <span>o</span> <span>r</span> <span>l</span> <span>d</span> <span>!</span>
</body>
</html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-rc1.js"></script>
<style>
div{line-height:60px;text-align:center}
</style>
<script type="text/javascript">
$(document).ready(function(){
var span=$("span"),arr=[60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5,5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5,5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60],l=0,k;