/* Reload Page on Orientation Change */ var supportsOrientationChange = "onorientationchange" in window, orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; window.addEventListener(orientationEvent, function() { window.location.reload() }, false); /* Display Mobile Menu */ $(document).ready(function(){ if($(window).width() <= 1020){ //only works on screensizes where mobile menu is present (in this case 1020px) $("#lower_bar_2").click(function(){ $("#pages-list").slideToggle(); }); } }); /* Add Class to Lower Bar on Mobile Navigation Click */ if($(window).width() <= 1020){ //only works on screensizes where mobile menu is present (in this case 1020px) $("#lower_bar_2").click(function(){ $(this).toggleClass("open"); }); } /* Display Menu Sub Nav */ $(document).ready(function(){ $("#pages-list > li:nth-child(3)").click(function(){ $("#pages-list > li:nth-child(3) > ul").toggle("fast"); }); }); /* Add Class to List Item on Click */ $("#pages-list > li:nth-child(3)").click(function(){ $(this).toggleClass("active"); }); /* Replace Span with Link in Navigation */ $(document).ready(function() { $('#pages-list > li:nth-child(1) > span').replaceWith('Home'); $('#pages-list > li:nth-child(2) > span').replaceWith('About'); $('#pages-list > li:nth-child(3) > span').replaceWith('Services'); $('#pages-list > li:nth-child(4) > span').replaceWith('Transformations'); $('#pages-list > li:nth-child(6) > span').replaceWith('Contact'); }); /* Add Sign In Link to Navigation */ $('