I have Side Navigation action in jQuery:
$(function openSidebar()) {
document.getElementById("sidebar").style.width = "250px";
document.getElementById("wrapper").style.marginLeft = "250px";
}
function closeSidebar() {
document.getElementById("sidebar").style.width = "0";
document.getElementById("wrapper").style.marginLeft= "0";
}
I need to change width from 250px to 100% on mobile devices. How can I get it on jQuery?
document.getElementByIdwith jQuery?$(...)and selectors to find elements in the DOM. In your case, it would be$('#sidebar').css('width', '250px'). Check out the jQuery API documentation.