Skip to content

Instantly share code, notes, and snippets.

@codeimpossible
Created July 20, 2012 19:45
Show Gist options
  • Save codeimpossible/3152819 to your computer and use it in GitHub Desktop.
Save codeimpossible/3152819 to your computer and use it in GitHub Desktop.
Pushstate example
$('a').click(function(e) {
e.preventDefault();
var url = this.href;
$.get(url, function(html) {
$('.newpage').html(html).animate({ left: "-= 1000px" }, function() {
window.history.pushState({}, "New Page Title", url );
});
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment