mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-03-22 09:22:17 +00:00
Website templates
This commit is contained in:
59
eat-restaurant-bootstrap-html5-template/js/custom.js
Normal file
59
eat-restaurant-bootstrap-html5-template/js/custom.js
Normal file
@@ -0,0 +1,59 @@
|
||||
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');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user