What I am trying to do is grab the height of the dropdown menu from the off-canvas menu and set it to the UL so it covers the height from where the menu is currently sitting. So If the dropdown menu is long in height, the div it's in should expand and the border-bottom should always be visible.
If you click on Corporate a few times, then click on SME and then back to Corporate, the corporate dropdown menu is sitting on top and of the DIV and the height is not being reset. I'm quite bad when it comes to explaining stuff, so take a look at the site here: Site URL
Here is the jQuery
// SLIDE OUT MENU
$(".menu-blue-bar button").on("click", function(e) {
$(".menu-blue-bar").toggleClass("menu-slide");
$(".menu-blue-bar button").toggleClass("is-active");
$(".menu-blue-bar .fade-in-menu .row").toggleClass("in-view");
e.preventDefault();
});
jQuery(
"<li class='back-button'><i class='icon icon-carousel-left-arrow'></i></li>"
).insertBefore(
".menu-blue-bar .main-menu-links .dropdown-menu li:first-child"
);
jQuery("li.back-button").on("click", function() {
jQuery(".menu-blue-bar ul.dropdown-menu").removeClass("show");
jQuery("ul.navbar-nav").css("height", "");
console.log("clicked back arrow");
});
jQuery(".menu-blue-bar .navbar-nav > li.dropdown").on("click", function() {
if (!$(".menu-blue-bar ul.dropdown-menu").hasClass("show")) {
$(".main-menu-links ul.navbar-nav").css({
height:
$(this)
.find("ul.dropdown-menu")
.height() + "px"
});
}
});
Screenshot: screenshot link