Jasny bootstrap: Mobile View

440 Views Asked by At

I 'm using Jasny bootstrap to create a left hand navigation menu and I came across an issue.

Jasny Mobile View

So, for mobile screens you get something like the above. How are you supposed to close the menu? This is from his own examples at his website

Thanks!

4

There are 4 best solutions below

0
On

Change the following style in the jasny-bootstrap.css file to desired width.

.navmenu, .navbar-offcanvas {width: 300px;}

e.g., 200px, which looks good in smaller screens like iphone 4.

1
On

You´re closing the menu by clicking on the active item in the list. In that case it´s the "Reveal"-item

0
On

I don't think there is a solution to my problem :P. The best you can do is create an "X" icon at the upper right corner of the menu or something, and attach the same click handler that jasny uses to open/close the menu.

Anyway, I think that this bootstrap left-hand-nav plugin does the same with much less code than jasny. I strongly suggest anyone reading this to give it a try :)

Cheers!

0
On

You may use something like that

$('.navmenu, .navbar-offcanvas').css({
  "width": (viewport - 50) + "px"
});

and you get fixed indent on all devices, see that answer