-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.js
45 lines (34 loc) · 1.21 KB
/
custom.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
(function ($) {
"use strict";
// NAVBAR
$('.navbar-collapse a').on('click',function(){
$(".navbar-collapse").collapse('hide');
});
$(function() {
$('.hero-slides').vegas({
slides: [
{ src: 'images/slides/sincere-laugh-showing-picture-smartphone-casual-meeting-with-best-friends-restaurant-terrace.jpg' },
{ src: 'images/happy-waitress-giving-coffee-customers-while-serving-them-coffee-shop.jpg' },
{ src: 'images/young-female-barista-wear-face-mask-serving-take-away-hot-coffee-paper-cup-consumer-cafe.jpg' }
],
timer: false,
animation: 'kenburns',
});
});
// CUSTOM LINK
$('.smoothscroll').click(function(){
var el = $(this).attr('href');
var elWrapped = $(el);
var header_height = $('.navbar').height() + 60;
scrollToDiv(elWrapped,header_height);
return false;
function scrollToDiv(element,navheight){
var offset = element.offset();
var offsetTop = offset.top;
var totalScroll = offsetTop-navheight;
$('body,html').animate({
scrollTop: totalScroll
}, 300);
}
});
})(window.jQuery);