-
Notifications
You must be signed in to change notification settings - Fork 5
/
osmfoundation.js
35 lines (32 loc) · 1.09 KB
/
osmfoundation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(function ($) {
$(document).ready(function () {
var $header = $('header'),
$body = $('body');
if (window.pageYOffset >= $header.height()) {
$header.addClass('fixed');
$body.addClass('header-fixed');
}
window.onscroll = function() {
if (window.pageYOffset >= $header.height()) {
$header.addClass('fixed');
$body.addClass('header-fixed');
}
else {
$header.removeClass('fixed');
$body.removeClass('header-fixed');
}
};
$('.nav-toggle').on('click', function () {
if ($(this).attr('aria-expanded') === 'false') {
$(this).attr('aria-expanded', 'true');
$('header').addClass('nav-toggled');
$('.mainnav').slideDown();
}
else {
$(this).attr('aria-expanded', 'false');
$('header').removeClass('nav-toggled');
$('.mainnav').slideUp();
}
});
});
})(jQuery);