简体   繁体   English

bootstrap-引导程序仅在调整大小后才能工作

[英]bootstrap - bootstrap works only after resizing

I'm developing a small application on codepen 我正在Codepen上开发一个小型应用程序

http://codepen.io/asamolion/full/VjKzYV/ http://codepen.io/asamolion/full/VjKzYV/

But the problem is that the bootstrap css doesn't load on page load. 但是问题在于,引导CSS不会在页面加载时加载。 But it works when I resize the browser. 但是当我调整浏览器大小时,它可以工作。

eg if I make the browser smaller and maximize it again then it will work but it's not working on first page load. 例如,如果我使浏览器更小并再次最大化它,那么它将可以工作,但不能在第一页加载时工作。

Does anyone know what the issue is? 有人知道这个问题是什么吗?

Here is my of the central div 这是我的中央分部

#quote-machine {
    text-align: center;
    padding: 10%;
    background: white;
    border-radius: 12px;
    box-shadow: inset 0 0 5px #AAA, 0 5px 10px #CCC;
    min-height: 60vh;
    min-width: 50vw;
}

Here are some screenshots 这是一些截图

First load 第一次加载 首次加载

Minimize 最小化 最小化

Maximize 最大化 最大化

It's width should be like "Maximize" on the first load but it isn't and I can't find the issue. 第一次加载时,其宽度应类似于“最大化”,但不是,我找不到问题。 Any help would be appreciated. 任何帮助,将不胜感激。

Thanks in advance. 提前致谢。

<div class="col-xs-12 col-sm-10 col-md-10 col-lg-10 col-lg-offset-1">

instead of using all the grid classes, 而不是使用所有网格类,

<div class="col-lg-10 col-lg-offset-1">

try with specific class and see 尝试特定的课程,看看

UPDATED: You can manually trigger it by setting the width of the fluid container on an ajax callback which is sort of hacky, but you only need to do it once. 更新:您可以通过在ajax回调上设置流体容器的宽度来手动触发它,这有点麻烦,但是您只需执行一次即可。

Here's a link to my working example: Link to working example using simple window resize 这是我的工作示例的链接使用简单的窗口调整大小链接到工作的示例

.done(function() {
  $('.container-fluid').css('width', '100%');
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM