Javascript 在引导中将窗口调整为移动大小
伙计们,我是bootstrap的初学者,我有那个代码Javascript 在引导中将窗口调整为移动大小,javascript,css,twitter-bootstrap,Javascript,Css,Twitter Bootstrap,伙计们,我是bootstrap的初学者,我有那个代码 引导示例 第一个引导项目 阅读此链接上的导航栏部分。他们提供的代码示例在屏幕调整到手机大小时隐藏菜单 在移动视图上显示为按钮 <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" clas
引导示例
第一个引导项目
阅读此链接上的导航栏部分。他们提供的代码示例在屏幕调整到手机大小时隐藏菜单 在移动视图上显示为按钮
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
切换导航
或者用这个来瘦身试试这样的方法
function AdjustLayoutonResize() {
windowWidth = $(window).width();
windowHeight = $(window).height();
fixedwidth = screenwidth;
if (windowWidth <= fixedwidth) {
$('#menus').css({ 'width': sliderwidth, 'display': none});
}
else {
$('#menus').css({ 'width': sliderwidth, 'display': 'block' });
}
}
功能调整LayoutResize(){
windowWidth=$(window.width();
windowHeight=$(window.height();
固定宽度=屏幕宽度;
如果(windowWidth)您是否编写了任何脚本来实现这一点?我尝试了$(window).调整大小,但没有解决..有什么建议吗?我建议您阅读引导部分。