Jasny bootstrap: Mobile View

痞子三分冷 提交于 2019-12-24 00:59:52

问题


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

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!


回答1:


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




回答2:


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.




回答3:


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




回答4:


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!



来源:https://stackoverflow.com/questions/35682102/jasny-bootstrap-mobile-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!