Remove JavaScript
Closed this issue · 2 comments
To be truly minimalistic, remove all JavaScript files.
The mobile menu could be activated with CSS3 only, albeit it would have to be tested on mobile devices.
The function gotoTop()
can be replaced by anchor links to href="#"
.
But openSidebar() / closeSidebar()
would have to be done with some CSS3 magic.
Create a <div id="myToggledUI">
containing some UI that you would like to show and hide.
Immediately above that, create an <input type="checkbox" id="myToggle" style="display: none;">
. This will make an invisible checkbox in the DOM.
Whatever DOM node you would like to use as the toggle control, wrap it in a <label for="myToggle"></label>
tag where the for attribute matches the id of the checkbox.
Use this CSS to hook it all up.
#myToggledUI {
display: none;
}
#myToggle:checked ~ #myToggledUI {
display: block;
}
This CSS says that the #myToggledUI element immediately preceded by a checked #myToggle element should be shown, otherwise hidden. The ~ operator is pretty cool! Here's a full working example. Source