azouaoui-med/pro-sidebar-template

how to delete toggle class for small screens?

firat131 opened this issue · 4 comments

This sidebar is very nice, thanks, but not mobile compatible. how to delete toggle class for small screens?

The sidebar should work just fine in mobile device ... if you can provide more details about the problem you got it will be helpful to understand the issue.
Note: the sidebar position changes in small screen from absolute to fixed, to make it overlap on the page-content elements

1
Image1: Desktop screen, no problem.
2
But image2: Mobile screen, sidebar does not close automatically. I want the sidebar to shut down automatically when the screen shrinks as I did in bootstrap. as follows (picture 3)
3

You can check the size of the window when loading the page and remove the toggled class from page-wrapper
This code should do the trick:

  if ($( window ).width() <= 767){
        $(".page-wrapper").removeClass("toggled");
    }

Thank you very much for your quick response and help.