Commit ff0121db authored by Jonas Heinrich's avatar Jonas Heinrich

start implementing popstate event

parent 204addb7
......@@ -18,8 +18,6 @@ $('body').on('click','.btn, .nav-item, logo, .video-item', function(e) {
url = $this.attr("href");
}
alert(url);
load_page(url);
return false;
......@@ -27,14 +25,12 @@ $('body').on('click','.btn, .nav-item, logo, .video-item', function(e) {
});
function load_page(url) {
$("content").empty();
$("content").hide().load(url).fadeIn('fast');
//window.history.pushState({href: url}, '', url);
window.history.pushState('', '', url);
}
window.addEventListener('popstate', function(e){
if(e.state)
load_page(e.state.href);
});
window.onpopstate = function(event) {
load_page(location.pathname);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment