do6siw
Last Updated: February 25, 2016
·
894
· mkdizajn
Kreso 300x300

Using jquery global ajax for spinner and stuff

When using ajax calls to somewhere, and you have to add spinner to make it all better for ux,, you can use global calls for that,

    /* make toggle nav on left */
$('.list-group a').click(function(){ 
    $(this).siblings().removeClass('active');
    $(this).addClass('active');
});
/* show spinner */
$( document ).ajaxStart(function() {
    $('#spinner').removeClass('hidden');
});
/* hide spinner */
$( document ).ajaxStop(function() {
    $('#spinner').addClass('hidden');
});

take a look here..

Picture

thsit, cheers :)

for demo I was using bootstrap from twitter

Say Thanks
Respond