samedi 27 juin 2015

Detecting back using window.history

Ok, I've looked around a bit, I'm trying to find a way to detect whether the back button has been pressed as I need to change a html element. So far I have the code.

function showMenu(){
$('#menuButtonsM').fadeIn();
window.location.hash = "menu";
}

This is one part of the script that changes the hash of the url allowing the back button to be utilised. Now I need to recognise when the back button has been pressed.

Any help would be greatly appreciated as I am a complete newbee, struggling to find my way.

Aucun commentaire:

Enregistrer un commentaire