activity indicator
activity indicator
I have an add to favorites image button that when clicked changes it's icon to unmark, posts to a php page, and displays a finished message when done. I wanted to also include an activity indicator, a spinner, throbber, whatever they are called. Everything works but my indicator. The indicator is just a div with the animated indicator, and a display of none. Any advice or suggestions are greatly appreciated. I think i have included the relevent code below. If not let me know.
maddogandnoriko
Jquery CODE:
-
$('.toggleFav').click(function(){
var $this = $(this);
$(this).iflip('images/buttons/plus.png','images/buttons/close.png');
var $seriesid = $(this).attr('id').split('_');
if ($this.is('.notFav')) {
$this.removeClass('notFav').addClass('isFav');
//make the POST request
$.post('markfavorite.php', {action:"markfav", seriesid: $seriesid[1], user_id: $seriesid[2] }, function(data) {
$.jGrowl(data);
});
} else if ($this.is('.isFav')) {
$this.removeClass('isFav').addClass('notFav');
//make the POST request
$.post('markfavorite.php', {action:"unmarkfav", seriesid: $seriesid[1], user_id: $seriesid[2] }, function(data) {
//$("#status p").html(data);
$.jGrowl(data);
});
}
}).ajaxStart(function(){
$('#loading').show();
});
THE BUTTON:
-
<img src="images/buttons/plus.png" class="toggleFav notFav" id="seriesid_{$show_id}"/>
INDICATOR CSS:
-
div.loading{
display:none;
}