Laimonas171
04-10-2011, 10:28 PM
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:
$("#blue").animate({width:200},2000),500;
$("#text").html("200"),1000;
$("#blue").animate({width:175},2000),500;
$("#text").html("175"),1000;
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:r elative"></div>
</td>
</tr>
</table>
</body>
</html>
Tryed
$("#text").html("150"),1000; but it gets only last value. i need sth like:
$("#blue").animate({width:200},2000),500;
$("#text").html("200"),1000;
$("#blue").animate({width:175},2000),500;
$("#text").html("175"),1000;
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:r elative"></div>
</td>
</tr>
</table>
</body>
</html>