how can i animate the number stored in the file?
I have a php script that check the total hits made for a web page. But now i want to animate that number stored in a file called hits.txt
The below jquery script has value attributes ( is it possible to replace those values to the ones which is stored in the file hits.txt url )?
the file where the hits are stored http://benson.vivoartistic.com/hits.txt
jQuery('#testAnimation').click(function() {
jQuery({value: 0}).animate({value: 110}, {
duration: 1000,
easing:'swing',
step: function() {
$('#testAnimationElement').text(Math.ceil(this.value) + " hits");
},
complete: function() {
$('#testAnimationElement').css({color:'#080'});
},
});
return false;
});
<p>Click the link to change the value: <strong><a href="#" id="testAnimation" title="Animate the element's value">Do it!</a></strong></p>
<h3>Page hits: <code id="testAnimationElement" style="font-size:1em;font-weight:bold;color:#800">0 hits</code></h3>
JSFIDDLE Link
http://jsfiddle.net/VKAYF/3/