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