|
|
@ -11,4 +11,16 @@ function setCookie(key, value, days) { |
|
|
|
var date = new Date(); |
|
|
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); |
|
|
|
document.cookie = key + "=" + value + "; expires=" + date.toUTCString(); |
|
|
|
} |
|
|
|
|
|
|
|
function forceToAnchor() { |
|
|
|
// this is probably a terrible hack
|
|
|
|
if (window.location.hash.startsWith("#")) { |
|
|
|
var anchor = $(window.location.hash); |
|
|
|
if (anchor.length) { |
|
|
|
$('html, body').animate({ |
|
|
|
scrollTop: anchor.offset().top |
|
|
|
}, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |