解决方案 »
- js 关于encodeURI编码问题,急!(有用到JQuery做ajax处理,程序是java开发的)
- 有个框架页面(a.b),如何在框架页面a中打开页面的时候跳转到B页面用JAvacscript如何实现,
- 一个 js问题 请教下
- jquery 录入部分中文或英文代码 同是把中文和英文中时显示在两个输入框内
- 请问各位大虾,javascript中的属性是写在构造函数中好呢还是写在prototype中好?谢谢!
- 自动列宽,用javascript设置其style.width
- ★★★产生事件的目标对象怎么获得?
- 关联菜单!
- 帮忙修改成为vbscript
- 如何制作滚动新闻
- 获取网页数据
- Highcharts使用什么标签属性可以得到一组Y值得和然后显示出来
<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;
$("input").click(function(){
setInterval(function(){
$.each(span,function(i,item){
$(item).css("font-size",arr[l+i]+"px");
});
l=l>22?0:l+1;
},100);
})
});
</script>
</head>
<body>
<input type="button" value="Start">
<div>
<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>
</div>
</body></html>