Active all Browser. Good luck
var process;
var delay = 50; //milisecond scroll top
var scrollPixel = 20; //pixel U want to change after milisecond
//Fix Undefine pageofset when using IE 8 below;
function getPapeYOfSet() {
var yOfSet = (typeof (window.pageYOffset) === "number") ? window.pageYOffset : document.documentElement.scrollTop;
return yOfSet;
}
function backToTop() {
process = setInterval(function () {
var yOfSet = getPapeYOfSet();
if (yOfSet === 0) {
clearInterval(process);
} else {
window.scrollBy(0, -scrollPixel);
}
}, delay);
}