-
Notifications
You must be signed in to change notification settings - Fork 0
/
nav-modify.js
68 lines (64 loc) · 1.36 KB
/
nav-modify.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function navChange(){
$('#navbar').css({
backgroundColor: 'white',
height: '10.5vh',
borderBottom: '1px solid lightgrey'
});
$('.hamburger').css({
color: 'black'
});
$('.navbar-brand').css({
textTransform: 'uppercase',
color: 'black'
});
$('.menu-a').css({
color: 'black'
});
}
$(document).on('scroll', function(){
if ($(window).scrollTop() > 0) {
navChange();
if (window.matchMedia('(max-width: 768px)').matches)
{
$('#navbar').css({
height: '12vh'
});
}
if (window.matchMedia('(max-width: 425px)').matches)
{
$('#navbar').css({
height: '11.5vh'
});
}
} else {
$('#navbar').css({
backgroundColor: 'transparent',
borderBottom: '0'
});
$('.hamburger').css({
color: 'black'
});
$('.navbar-brand').css({
textTransform: 'capitalize',
color: 'black'
});
$('.menu-a').css({
color: 'black'
});
}
});
//navbar hamburger menu
$(document).ready( function(){
$('body').on('click', '.hamburger', function() {
$('#myNav').animate({
display: 'block',
height: '100%'
}, 'fast');
});
$('body').on('click', '.closebtn', function(){
$('#myNav').animate({
display: 'none',
height: '0%'
}, 'fast');
});
});