Skip to content

Instantly share code, notes, and snippets.

@danfisher85
Created August 1, 2019 12:20
Show Gist options
  • Save danfisher85/06c45c3a29d1dfc094b3e6bc6564ce02 to your computer and use it in GitHub Desktop.
Save danfisher85/06c45c3a29d1dfc094b3e6bc6564ce02 to your computer and use it in GitHub Desktop.
/**
* @package Template
* @version 1.0.0.
* Template Scripts
* Created by Dan Fisher
*/
;(function ($){
'use strict';
// Preloader
$(window).on('load', function () {
$('#js-preloader').delay(0).fadeOut();
$('#js-preloader-overlay').delay(200).fadeOut('slow');
});
$.fn.exists = function () {
return this.length > 0;
};
/* ----------------------------------------------------------- */
/* Predefined Variables
/* ----------------------------------------------------------- */
var mainNav = $('.main-nav');
var Core = {
initialize: function () {
this.stickyHeader();
this.miscScripts();
},
stickyHeader: function () {
var $headerHeight = $('#header').innerHeight();
$('.page-heading').css('padding-top', $headerHeight);
$('#header').jPinning({
// offset for header to hide or show in pixels
offset: 100,
});
},
miscScripts: function () {
},
};
$(document).on('ready', function () {
Core.initialize();
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment