Please look at this fiddle http://jsfiddle.net/rabelais/zDu2s/1/
There are three bars that when clicked play/pause music. The divs also animate on click.
When the animation is complete a refresh button appears and resets the animation width to 0.
My question is how can I make the song and animation restart when the refresh button is clicked on.
I am only displaying a small amount of the code below as there is so much and one really ned to look at the fiddle above to see all the code.
var $sounds = $('.sound'),
$bars = $('#sound-bars .bars');
$bars.click(function () {
var $this = $(this),
$target = $($this.data('target')),
target = $target[0];
$bars.not(this).removeClass('playing');
$sounds.not($target).each(function () {
this.pause();
});
$this.toggleClass('playing');
if ($this.hasClass('playing')) {
target.play();
} else {
target.pause();
}
})