So my Question is as following:
I have this HTML code extract of an mobile side menu:
<input type="checkbox" id="activator" class="activator" name="menu">
<div class="toplayer"></div>
<label for="activator" class="activator" name="menu">
<img class="icon" src="../media/menu_new.png" alt="Menu">
</label>
<div class="menu">
<ul class="menu">
<li>
<input type="checkbox" id="d1" class="subtivator" name="submenu">
<div class="dropdown"><label for="d1"><span class="submenu">...</span></label></div>
<div class="drawer">
<label for="activator" class="activator" name="menu"><a href="#">...</a></label>
And what I wanna do is that if you click on the link in the last line, the parental label triggers the checkbox from the first line, so that the whole menu gets closed automaticaly. The link itself works, but the menu just stays open because the checkbox won't get triggered by the label. If you run the code snippet, you can clearly see that there is a trigger animation for the checkbox, but it just does not CHANGE. If you remove the "href"-attribute on the -tag, it suddenly works. The label ist 100% identical to the label from line 6 which I used to actually open up and close the menu. I also already looked up a few references, but none of them had any restrictions regarding the -tag and -tag. I just can't figure out where the error is located and, of course, can't fix it because of that.
I really hope some of you guys can help me out with this a little bit.
Thanks in advance
Aucun commentaire:
Enregistrer un commentaire