Created
August 1, 2019 12:20
-
-
Save danfisher85/06c45c3a29d1dfc094b3e6bc6564ce02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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