From: Anthony Talarico Date: Mon, 6 Nov 2017 21:10:37 +0000 (-0500) Subject: adding active class to topbar menu items since they are custom X-Git-Tag: v1.0.0^2~47 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=f9ae90a2bfe15d001476a329eda5bc3ddb2009e5;p=WP-Themes%2Fmeetingsmichigan.git adding active class to topbar menu items since they are custom using js to determine which topbar page is currently active to apply the active class to it --- diff --git a/js/app.js b/js/app.js index 87c2307..514885b 100644 --- a/js/app.js +++ b/js/app.js @@ -35,12 +35,19 @@ $(document).ready(function () { }); var headerVideo = document.getElementById('front-page-video'); - // if (headerVideo) { - // headerVideo.play(); - // } - if($(window).width() > 1024){ $(headerVideo).attr("controls",false); - console.log(Modernizr); } + + var loc = window.location.href; // returns the full URL + if(/regions/.test(loc)) { + $('#interactive-map > li').addClass('active'); + } + if(/destinations/.test(loc)) { + $('#dropdown-destination > li').addClass('active'); + } + if(/venues/.test(loc)) { + $('#dropdown-venues > li').addClass('active'); + } + }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index c359dcf..0eacdaa 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -26,12 +26,19 @@ $(document).ready(function () { }); var headerVideo = document.getElementById('front-page-video'); - // if (headerVideo) { - // headerVideo.play(); - // } - if($(window).width() > 1024){ $(headerVideo).attr("controls",false); - console.log(Modernizr); } + + var loc = window.location.href; // returns the full URL + if(/regions/.test(loc)) { + $('#interactive-map > li').addClass('active'); + } + if(/destinations/.test(loc)) { + $('#dropdown-destination > li').addClass('active'); + } + if(/venues/.test(loc)) { + $('#dropdown-venues > li').addClass('active'); + } + });