-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (36 loc) · 1.17 KB
/
app.js
File metadata and controls
41 lines (36 loc) · 1.17 KB
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
$(window).load(function() {
// Enable navigation menu open/close
if($('.mob-menu-nav').length > 0) {
$('body').on('click', '.mob-menu-trigger', function() {
var $this = $(this),
$pushMenu = $this.closest('.mob-menu').find('.mob-menu-nav'),
$body = $this.closest('body');
if($this.hasClass('active')) {
$this.removeClass('active');
$body.removeClass('mob-menu-toright');
$pushMenu.removeClass('mob-menu-open');
} else {
$this.addClass('active');
$body.addClass('mob-menu-toright');
$pushMenu.addClass('mob-menu-open');
}
});
}
/* TO-DO: If needed implement smooth scroll
if($(".smooth-scroll").length) {
$(".smooth-scroll").click(function(smooth){
smooth.preventDefault();
var destination = 0,
docHeight = $(document).height(),
winHeight = $(window).height(),
offsetTop = $(this.hash).offset().top;
if(offsetTop > docHeight - winHeight){
destination = docHeight - winHeight;
}else{
destination = offsetTop;
}
$('html,body').animate({scrollTop:destination}, 700, 'easeInCubic');
});
}
*/
});