From 33a4e12575dc0ac6c5395148d550875c26af21a4 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 24 Jan 2018 11:29:51 -0500 Subject: [PATCH] adding sticky scroll for topbar in mobile fixing the sticky in topar in mobile --- footer.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/footer.php b/footer.php index af615e5..027ceb4 100644 --- a/footer.php +++ b/footer.php @@ -152,8 +152,18 @@ get_template_part('template-parts/search','overlay'); $('#scroller').removeClass('stuck'); $('.nav_logo').removeClass('logo-adjust'); } - }); + if( $(window).width() < 1024 ){ + $(window).scroll(function() { + if ($(window).scrollTop() > 30) { + $('.sticky-container').addClass('stuck'); + $('.nav_logo').addClass('logo-adjust'); + } else { + $('.sticky-container').removeClass('stuck'); + $('.nav_logo').removeClass('logo-adjust'); + } + }); + } -- 2.17.1