bnbweb/themes/vr/web/js/let.js

30 lines
882 B
JavaScript
Raw Normal View History

2022-11-14 15:49:28 +00:00
// JavaScript Document
(function() {
let winW = $(window).width();
let headerH = $('header').outerHeight();
let bannerH = $('.bannerArea').height();
let htmlbody = $('html, body');
let main = $('.mainArea');
let header = $("header");
let footerTop = $('footer .top');
footerTop.on("click", function(){
htmlbody.animate({
scrollTop: 0
}, 1000);
});
$(window).scroll(function() {
let winScroll = $(window).scrollTop();
if(winScroll > bannerH && winW > 1180) {
main.css('padding-top',headerH);
header.addClass('fixed');
} else {
main.css('padding-top','0px');
header.removeClass('fixed');
}
})
})($)