Skip to content

Instantly share code, notes, and snippets.

@Abban
Created June 19, 2013 18:04
Show Gist options
  • Select an option

  • Save Abban/5816442 to your computer and use it in GitHub Desktop.

Select an option

Save Abban/5816442 to your computer and use it in GitHub Desktop.
Backbone loading spinner. First go and create and install a spinner on the spin.js website.
#loading{
position:fixed;
z-index:999;
top:0;
left:0;
width:100%;
height: 100%;
background:rgba(0,0,0,0.3);
}
<div id="loading"></div>
$(function(){
$("#loading").spin({/* YOUR SPINNER OPTIONS */}).hide();
$('#loading').ajaxStart(function(){ $(this).fadeIn(); });
$('#loading').ajaxComplete(function(){ $(this).fadeOut(); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment