Skip to content

Instantly share code, notes, and snippets.

@asufian97
Created February 28, 2018 01:49
Show Gist options
  • Save asufian97/21a3ed212e11ba9d407a9149db5e0b4e to your computer and use it in GitHub Desktop.
Save asufian97/21a3ed212e11ba9d407a9149db5e0b4e to your computer and use it in GitHub Desktop.
use js for themeforest
//[Master Javascript]
//Project: Delicious Restaurant - Onepage Html Responsive Template
//Version: 1.1
//Last change: 18/10/2016 [fixed bug]
//Primary use: Delicious Restaurant - Onepage Html Responsive Template
//theme script here
$(document).ready(function(){
"use strict"; // Start of use strict
// jQuery for page scrolling feature - requires jQuery Easing plugin
$('a.page-scroll').on('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: ($($anchor.attr('href')).offset().top - 70)
}, 1250, 'easeInOutExpo');
event.preventDefault();
});
// Highlight the top nav as scrolling occurs
$('body').scrollspy({
target: '.navbar-fixed-top',
offset: 71
});
// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').on('click', function(event) {
$(this).closest('.collapse').collapse('toggle');
});
// Offset for Main Navigation
$('#mainNav').affix({
offset: {
top: 100
}
})
// Initialize and Configure Scroll Reveal Animation
window.sr = ScrollReveal();
sr.reveal('.sr-icons', {
duration: 600,
scale: 0.3,
distance: '0px'
}, 200);
sr.reveal('.sr-button', {
duration: 1000,
delay: 200
});
sr.reveal('.sr-contact', {
duration: 600,
scale: 0.3,
distance: '0px'
}, 300);
//Script to Activate the Carousel
$('.carousel').carousel({
interval: 5000 //changes the speed
})
// prettyPhoto
$("a[rel^='alternate']").prettyPhoto();
// Datepicker
$(".date").datepicker();
}); // End of use strict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment