js代码
<script language="javascript"> function si(){ var time = window.setInterval(function(){ a=$("#line").width(); b=(a/200*100).toFixed(0); $("#percent").html(b+"%"); $("#percent").css({"left":(a-32)+"px"}); if(b==100) { clearInterval(time); play.src = "pause.png"; } },70); } function processerbar(time){ $("#probar").css({"display":"block"}); $("#line").each(function(i,item){ var a=parseInt($(item).attr("w")); $(item).animate({ width: a+"%" },time); }); si(); }; var onOff = true; $("#play").click(function(){ if(onOff === true){ processerbar(2000); play.src = "play.png"; onOff= false; }else{ $("#line").stop(); play.src = "pause.png"; onOff = true; } }); </script>