diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 345a7ad5..5ff6ed1d 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -117,6 +117,12 @@ textarea { text-decoration: none; } +.topnav .nav .open>a, +.topnav .nav .open>a:focus, +.topnav .nav .open>a:hover { + background: transparent; +} + .navbar .dcl-link { display: block; padding: 15px; diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 5e919045..dc5a9108 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -104,21 +104,33 @@ }); $('.url').click(function(event) { event.preventDefault(); - var href = $(this).attr('href'); + var $this = $(this); + var href = $this.attr('href'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); if (href[0] === "#") { - if ($(href).length) { - $('html, body').animate({ - scrollTop: $(href).offset().top - 50 - }, 1000); - } + scrollToElement(href); } else if (href) { - window.location = href; + var path = $(this).prop('href').split('#'); + var currentPath = window.location.origin + window.location.pathname; + if (!path[1]) { + window.location = href; + } else if (currentPath == path[0]) { + scrollToElement('#' + path[1]); + } } }); } + function scrollToElement(el) { + var $el = $(el); + if ($el.length) { + $('html, body').animate({ + scrollTop: $el.offset().top - 50 + }, 1000); + } + } + function verifiedUrl() { if (window.location.href.indexOf('#success') > -1) { form_success(); diff --git a/datacenterlight/templates/datacenterlight/cms/contact.html b/datacenterlight/templates/datacenterlight/cms/contact.html index 5d745a55..33dc9034 100644 --- a/datacenterlight/templates/datacenterlight/cms/contact.html +++ b/datacenterlight/templates/datacenterlight/cms/contact.html @@ -3,9 +3,9 @@