jQuery1.4 中逐个修改一句话中各个字的字体大小 jquery字体animatecallback 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <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> 各位,帮忙看下这段JS,在FF支持,在IE不支持,怎么解决? Ext GridPanel问题请教 如何使横向跑马灯不自动换行? 正则表达式 提示"Error:无法设置 innerText 属性。 该操作的目标元件无效。"请问是什么原因? javascript取得焦点和失去焦点 js浏览器兼容问题 如何在WindowsXP SP2版下实现自动弹出窗口,一旦解决,200RMB报酬。 门外汉问3个很菜的问题。 JavaScript可以跨平台吗,运行时它是由谁来解释的? 获取网页数据 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>