-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
52 lines (43 loc) · 1.17 KB
/
script.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
$(document).ready(function () {
$('.navbar-toggler').click(function () {
$('.navbar-toggler').toggleClass('change');
})
//window scroll
$(window).scroll(function () {
let position = $(this).scrollTop();
if (position >= 149) {
$('.navbar').addClass('navbar-background')
$('.navbar').addClass('fixed-top');
} else {
$('.navbar').removeClass('navbar-background');
$('.navbar').removeClass('fixed-top');
}
})
//smooth scroll
$('.nav-item a').click(function (link) {
link.preventDefault();
let target = $(this).attr('href');
$('html, body').stop().animate({
scrollTop: $(target).offset().top
}, 2000);
})
//banner scroll
$('.banner-btn').click(function (link) {
link.preventDefault();
let target = $(this).attr('href');
$('html, body').stop().animate({
scrollTop: $(target).offset().top
}, 3000);
})
// Isotope
let $grid = $('.grid').isotope({
// options
});
// filter items on button click
$('.filter-button-group').on('click', 'button', function () {
let filterValue = $(this).attr('data-filter');
$grid.isotope({
filter: filterValue
});
});
})