briangonzalez / codrops-medium-style-page-transitions

The repository for this article: http://tympanus.net/codrops/2013/10/30/medium-style-page-transition/
258 stars 40 forks source link

Back button ? #4

Closed agenceKanvas closed 10 years ago

agenceKanvas commented 10 years ago

Any tips to add a back button ? Tried some things but didn't get it to work. Any advice would be great ! Thanks a lot, and great tutorial !

briangonzalez commented 10 years ago

@KuneStudio Thanks! Here's how you'd want to do it.

HTML

First, create a button on your html.

<button class='back'>Go Back</button>

JAVASCRIPT

Then bind an event list to it, which tells the HTML5 history object to go "back".

$('button.back').on('click', function(){
  history.back()
})