Created
May 2, 2019 11:00
-
-
Save Dziuperman/0b077d9eedfc36d36ca171406dd714a0 to your computer and use it in GitHub Desktop.
Добавление шапке сайта оберти и класса для фиксированного положения
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $(function() { | |
// 'use strict'; | |
// let offset = $('.header').offset(); | |
// $(window).scroll(function() { | |
// if ($(window).scrollTop() > offset.top) { | |
// $('.header').addClass('fixedHeader'); | |
// } else { | |
// $('.header').removeClass('fixedHeader'); | |
// } | |
// }); | |
// }); | |
let headerHeight = $('.header').innerHeight(); | |
let fixedHeaderHeight = $('.fixedHeader').innerHeight(); | |
$('.main-header').height(headerHeight); | |
window.addEventListener('resize', function() { | |
let headerHeight = $('.header').innerHeight(); | |
$('.main-header').height(headerHeight); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment