Created
September 8, 2010 20:25
-
-
Save aarongustafson/570773 to your computer and use it in GitHub Desktop.
Makes sure the layout is loaded (Webkit sometimes loses the design when the back button is used to return to a URL using a hash and slash anchor structure)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make sure a user hitting the back button doesn't kill the layout | |
if ( window.addEventListener ) | |
{ | |
window.addEventListener('pageshow',function(e){ | |
if (e.persisted) | |
{ | |
setTimeout(function(){ | |
window.scrollTo(window.scrollX,window.scrollY+1); | |
},10); | |
} | |
}, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment