Enable Stickyfill on screen width > 768px

This commit is contained in:
Michael Rose
2016-03-17 15:38:07 -04:00
parent e72642539e
commit f85dd7aee2
8 changed files with 34 additions and 12 deletions

View File

@@ -10,6 +10,27 @@ $(document).ready(function(){
// init sticky sidebar
$(".sticky").Stickyfill();
var stickySideBar = function(){
var windowWidth = $(window).width();
if (windowWidth > 768) {
// fix
Stickyfill.rebuild();
Stickyfill.init();
} else {
// unfix
Stickyfill.stop();
}
};
stickySideBar();
$(window).resize(function(){
stickySideBar();
});
// init smooth scroll
$("a").smoothScroll({offset: -20});