webapps.wiki: simplify and fix resize issue on mobile.
parent
9336cd6efc
commit
d326e8f788
|
@ -20,6 +20,8 @@
|
|||
|
||||
@media screen and (max-width: 600px) {
|
||||
#left {
|
||||
position: absolute;
|
||||
margin-top: 40px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,11 @@
|
|||
|
||||
function resetSidebar() {
|
||||
var l = document.getElementById("left");
|
||||
var m = document.getElementById("menu");
|
||||
l.style.position = "";
|
||||
l.style.display = "";
|
||||
l.style.marginTop = "";
|
||||
m.style.backgroundColor = "";
|
||||
}
|
||||
|
||||
window.addEventListener("resize", resetSidebar);
|
||||
|
||||
function toggleSidebar() {
|
||||
var l = document.getElementById("left");
|
||||
var m = document.getElementById("menu");
|
||||
if (l.style.display === "") {
|
||||
l.style.position = "absolute";
|
||||
l.style.display = "inline";
|
||||
l.style.marginTop = "40px";
|
||||
m.style.backgroundColor = "#f3f2ea";
|
||||
} else {
|
||||
l.style.position = "";
|
||||
l.style.display = "";
|
||||
l.style.marginTop = "";
|
||||
m.style.backgroundColor = "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue