Most examples I found on the net for a responsive sidebar had a reference to jQuery. For two lines of code, I find it an unnecessary overhead. So this is a basic page with no dependencies that has a toggle-able sidebar as well as a media query javascript that hides the sidebar below a breakpoint screen width. Modify as necessary. Maybe tricks could be added such as the one to change the hamburger to X when the sidebar is visible. https://jsbin.com/romiqov/2/edit?html,output <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>SideBar test</title> <style> * { margin: 0; padding: 0; font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } #sidebar { ...
Comments
Post a Comment