SRL Archive - Web Development

[Help Needed] jquery Something like progress bar...


Laimonas171

2011-04-10 18:28:20

So i need that then Blue line changes it width each time renews #text
Tryed
 $("#text").html("150"),1000;
but it gets only last value. i need sth like:
[PHP] $("#blue").animate({width:200},2000),500;
$("#text").html("200"),1000;
$("#blue").animate({width:175},2000),500;
$("#text").html("175"),1000;[/PHP]


Any ideas?
Maybe here is any function or sth, that change text only after animation was done?

Code below…
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>



<script type="text/javascript">
$(document).ready(function(){
$("#blue").animate({width:300},2000),500;
$("#blue").animate({width:200},2000),500;
$("#blue").animate({width:100},2000),500;


});
</script>


<table width="620px" border="0" style="border:1px solid black;"><tr>
<td align='left' style="width:300px; border-right:1px solid black;"><p id='text'>100</p>
<div id='blue' style="background:blue;height:25px;width:300px;position:relative"></div>
</td>
</tr>
</table>
</body>
</html>

Laimonas171

2011-04-11 10:00:11

anyone?

Find out.
[PHP]$('#blue').animate({width:300}, 1000, function(){$("#text").html($("#blue").width()) });[/PHP]