I am newbie in js and working on Sidebar navigation and i read an w3school tutorial here is a script but it's only work for desktop full screen browser.
<script>
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
</script>
as you can see it expand width 250px but in order to make it responsive for mobile browser it should expand 70-80px.
How can i run it for different resolutions?