Dale wrote:
> How can I do the main menu on ...
>
> https://www.w3.org/
>
> ?
There are many ways. Most involve using a client-side framework for
which code may be generated server-side. Usually it is generated by a CMS.
But toggling a main menu like this can be done without scripting, using
just a checkbox and CSS; e.g.:
.nav {
display: relative;
}
.nav .checkbox {
position: absolute:
visibility: hidden;
}
.nav .checkbox + .checkbox-label {
/* appearance of the menu button when the main menu is hidden */
}
.nav .checkbox:checked + .checkbox-label {
/* appearance of the menu button when the main menu is shown */
}
.nav .checkbox + .checkbox-label + .menu {
display: none;
}
.nav .checkbox:checked + .checkbox-label + .menu {
display: block;
}
HTML:
<nav class='nav'>
<input type='checkbox' class='checkbox' id='cbMenu'>
<label for='cbMenu' class='checkbox-label'
title='Toggle menu'>foo</label>
<menu class='menu'>
<li>...</li>
</menu>
</nav>
> I have been on and doing website since mid-90's
>
> new to javascripts
There is no "javascript(s)".
Given your point in the learning curve, I recommend to attempt to do it
without scripting first. At some point you will need to learn and use
CSS anyway.
--
PointedEars
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.