Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 19, 2014 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/ab3061ea0368f795fce0 to your computer and use it in GitHub Desktop.
Save devdays/ab3061ea0368f795fce0 to your computer and use it in GitHub Desktop.
Single Page App - Overriding Swap in Sammy
// implements a 'fade out'/'fade in'
this.swap = function(content, callback) {
var context = this;
context.$element().fadeOut('slow', function() {
context.$element().html(content);
context.$element().fadeIn('slow', function() {
if (callback) {
callback.apply();
}
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment