23 lines
686 B
JavaScript
23 lines
686 B
JavaScript
var isInMobile = false;
|
|
|
|
function jsinject_init() {
|
|
let navy = document.getElementById('side-nav');
|
|
if (visualViewport.width < visualViewport.height) {
|
|
document.body.style.width = '100%';
|
|
navy.style.width = '6px';
|
|
navy.onclick = (function () {
|
|
if (navy.clientWidth > 0) {
|
|
navy.style.width = 0;
|
|
}
|
|
else {
|
|
navy.style.width = document.body.clientWidth + 'px';
|
|
}
|
|
});
|
|
isInMobile = true;
|
|
}
|
|
else {
|
|
document.body.style.width = '80%';
|
|
document.body.style.margin = 'auto';
|
|
navy.style.marginLeft = document.body.clientLeft + 'px';
|
|
}
|
|
} |