From f9ae90a2bfe15d001476a329eda5bc3ddb2009e5 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 6 Nov 2017 16:10:37 -0500 Subject: [PATCH] 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 --- js/app.js | 17 ++++++++++++----- js/custom/pageSetup.js | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) 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'); + } + }); -- 2.17.1