Source:
Демо:
Плагины:
Подключение:
//
Разметка:
//
Стили:
// to intercept scrolling
.page {
&__locker {
position: fixed;
z-index: 999999;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: auto;
opacity: 0;
display: none;
&:before {
content: " ";
height: 1000vh;
display: block;
}
&.active {
display: block;
}
}
}
Инициализация:
// will load with scrollTop set to 0 initially
window.history.scrollRestoration = "manual";
$(window).on("beforeunload", function () {
$(window).scrollTop(0);
});
function handleWindowLoad() {
$section.addClass("intro-zhk--loaded");
// hide scroll locker when initial animation of page completed
setTimeout(() => {
$(".page__locker").removeClass("active");
}, 1200);
}
$(window).on("load", handleWindowLoad);
0 комментариев