-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (27 loc) · 758 Bytes
/
app.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
$(document).ready(function() {
const gallery = $('.gallery__canvas a');
const navicon = $('#navicon');
const nav = $('.nav');
const itemMenu = $('nav a');
gallery.simpleLightbox();
navicon.click(function(e) {
e.preventDefault();
nav.toggleClass('open');
$(this).toggleClass('icon-close');
});
itemMenu.click(function(){
nav.removeClass('open');
navicon.removeClass('icon-close');
});
$('a[href^="#"]').click(function() {
var destino = $(this.hash);
if (destino.length == 0) {
destino = $('a[name="' + this.hash.substr(1) + '"]');
}
if (destino.length == 0) {
destino = $('html');
}
$('html, body').animate({ scrollTop: destino.offset().top }, 500);
return false;
});
});