-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
77 lines (66 loc) · 1.57 KB
/
index.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
69
70
71
72
73
74
75
76
77
window.onscroll = function() {myFunction()};
var header = document.getElementById("myHeader");
var Nav = document.getElementById("myNav");
var x = window.matchMedia("(min-width: 992px)")
var sticky = header.offsetTop;
function myFunction(x) {
if (window.pageYOffset > sticky) {
Nav.classList.add("bg-black");
Nav.classList.remove("bg-dark");
}
else {
Nav.classList.add("bg-dark");
Nav.classList.remove("bg-black");
}
}
$(".menu a").on('click', function(){
$("html, body").animate({
scrollTop: $($.attr(this, 'href')).offset().top
}, 1000);
});
$('.navbar-nav>li>a').on('click', function(){
$('.navbar-collapse').collapse('hide');
});
const toShow= document.querySelectorAll('.show-on-scroll');
observer= new IntersectionObserver((entries)=>{
entries.forEach(entry=>{
if(entry.intersectionRatio>0){
entry.target.classList.add("is-visible");
}
else{
entry.target.classList.remove('is-visible');
}
})
})
toShow.forEach(ele=>{
observer.observe(ele)
console.log(ele)
})
$(document).ready(function() {
$('.gallery1').magnificPopup({
type:'image',
delegate: 'a',
gallery: { enabled: true }
});
});
$(document).ready(function() {
$('.gallery2').magnificPopup({
type:'image',
delegate: 'a',
gallery: { enabled: true }
});
});
$(document).ready(function() {
$('.gallery3').magnificPopup({
type:'image',
delegate: 'a',
gallery: { enabled: true }
});
});
$(document).ready(function() {
$('.gallery4').magnificPopup({
type:'image',
delegate: 'a',
gallery: { enabled: true }
});
});