diff --git a/assets/css/styles.css b/assets/css/styles.css index b426929..9778b25 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -136,7 +136,8 @@ footer { /* 4. Navbar */ .nav { - @apply hidden flex-col w-full pl-0 my-0 absolute bg-yuika-blue-700; + @apply hidden flex-col w-full pl-0 my-0 absolute bg-yuika-blue-700 left-0 right-0; + top: 100%; } .nav li { @apply flex flex-row justify-start items-center my-0 py-2 text-white text-sm px-2 h-12 px-4; @@ -145,10 +146,6 @@ footer { @apply align-middle w-full table-cell; line-height: 2rem; } -#menushow:hover .nav { - @apply block w-screen; - right: -1rem; -} @screen md { .nav { @@ -157,10 +154,6 @@ footer { .nav li { @apply object-contain justify-center items-center border-b-0 border-t-0 my-0 inline-block h-full; } - #menushow:hover .nav { - @apply pt-0 right-0; - width: initial; - } } .nav-fixed { diff --git a/assets/js/nav-menu.js b/assets/js/nav-menu.js new file mode 100644 index 0000000..a5beec4 --- /dev/null +++ b/assets/js/nav-menu.js @@ -0,0 +1,17 @@ + +$("#menushow").click(function() { + if($('.nav').css('display') == 'none') { + $(".nav").show(); + } else { + $(".nav").hide(); + } +}); + +$(window).resize(function() { + var wi = $(window).width(); + if(wi >= 768) { + $(".nav").show(); + } else { + $(".nav").hide(); + } +}); diff --git a/partials/site-header.hbs b/partials/site-header.hbs index 1f30af6..17b5e38 100644 --- a/partials/site-header.hbs +++ b/partials/site-header.hbs @@ -1,5 +1,5 @@