Skip to content
Snippets Groups Projects
Verified Commit 230d31b8 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Fix submenus not showing

parent 5d04608f
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -144,7 +144,7 @@ nav.subnav {
height: 40px;
position: absolute;
}
.show-subnav1 nav.subnav1, .show-subnav2 nav.subnav2 {
.show-subnav1 nav.subnav1, .show-subnav2 nav.subnav2, .show-subnav3 nav.subnav3 {
transition: 0.3s;
margin-top: 64px;
z-index: 4;
......
......@@ -58,7 +58,7 @@
<a class="hide-on-small-only left" id="o-nas">
O nás
</a>
<a class="hide-on-small-only left" id="o-nas">
<a class="hide-on-small-only left" id="aktuality">
Aktuality
</a>
<a class="hide-on-small-only left" id="clanky">
......@@ -76,19 +76,30 @@
$("#o-nas").click(function() {
var body = $("body");
body.removeClass("show-subnav2");
body.removeClass("show-subnav3");
if(body.hasClass("show-subnav1"))
body.removeClass("show-subnav1");
else
body.addClass("show-subnav1")
body.addClass("show-subnav1");
});
$("#clanky").click(function() {
$("#aktuality").click(function() {
var body = $("body");
body.removeClass("show-subnav1");
body.removeClass("show-subnav3");
if(body.hasClass("show-subnav2"))
body.removeClass("show-subnav2");
else
body.addClass("show-subnav2")
body.addClass("show-subnav2");
});
$("#clanky").click(function() {
var body = $("body");
body.removeClass("show-subnav1");
body.removeClass("show-subnav2");
if(body.hasClass("show-subnav3"))
body.removeClass("show-subnav3");
else
body.addClass("show-subnav3");
})
$("body").click(function(e) {
if(!($(e.target).parents("a").length || $(e.target).is("a"))) {
$("body").removeClass("show-subnav2").removeClass("show-subnav1");
......@@ -141,7 +152,7 @@
</div>
</nav>
<!-- Lower nav 2 - Aktuality -->
<nav class="subnav subnav1 hide-on-small-and-down" role="navigation">
<nav class="subnav subnav2 hide-on-small-and-down" role="navigation">
<div class="nav-wrapper container">
<ul class="right">
<li><a href="{{ config.baseurl }}/tag/aktuality">Všechny aktuality</a></li>
......@@ -152,7 +163,7 @@
</div>
</nav>
<!-- Lower nav 3 - Články -->
<nav class="subnav subnav2 hide-on-small-and-down" role="navigation">
<nav class="subnav subnav3 hide-on-small-and-down" role="navigation">
<div class="nav-wrapper container">
<ul class="right">
<li><a href="{{ config.baseurl }}/tag/clanky">Všechny články</a></li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment