mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2025-10-27 16:03:10 +01:00
59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
jQuery(function($) {
|
|
|
|
'use strict';
|
|
|
|
$('#quote-carousel').carousel({
|
|
pause: true,
|
|
interval: 4000,
|
|
});
|
|
|
|
new WOW().init();
|
|
|
|
$(function() {
|
|
$('a[href*=#]:not([href=#])').click(function() {
|
|
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
|
|
var target = $(this.hash);
|
|
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
|
if (target.length) {
|
|
$('html,body').animate({
|
|
scrollTop: target.offset().top - 40
|
|
}, 1000);
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('#header_wrapper').scrollToFixed();
|
|
$('.res-nav_click').click(function() {
|
|
$('.mainNav').slideToggle();
|
|
return false
|
|
|
|
});
|
|
|
|
$('#main-nav').onePageNav({
|
|
currentClass: 'active',
|
|
changeHash: false,
|
|
scrollSpeed: 950,
|
|
scrollThreshold: 0.2,
|
|
filter: '',
|
|
easing: 'swing',
|
|
begin: function() {},
|
|
end: function() {
|
|
if (!$('#main-nav ul li:first-child').hasClass('active')) {
|
|
$('.header').addClass('addBg');
|
|
} else {
|
|
$('.header').removeClass('addBg');
|
|
}
|
|
|
|
},
|
|
scrollChange: function($currentListItem) {
|
|
if (!$('#main-nav ul li:first-child').hasClass('active')) {
|
|
$('.header').addClass('addBg');
|
|
} else {
|
|
$('.header').removeClass('addBg');
|
|
}
|
|
}
|
|
});
|
|
|
|
}); |