【发布时间】:2018-10-26 12:45:14
【问题描述】:
我有一个窗口,下面有一个输入和一个 jquery ui 进度条。
该栏应与输入字段具有相同的宽度。不幸的是,Internet Explorer 似乎需要特别小心,因为它根本不显示该栏。
现在唯一可行的是设置固定宽度。但这显然不是我选择的解决方案。
我搜索了这个问题,但我找不到任何东西。
对此有何建议?
编辑:
我使用 col-auto 的原因:How to center a bootstrap 4 row vertically and horizontally when there are some rows before
我一般想要达到的目标:Nest rows inside a bootstrap 4 column
$(document).ready(function() {
$("#progress").progressbar();
$("#progress").progressbar("value", 50);
});
#progress {
height: 10px;
}
#progress .ui-progressbar-value {
background: red;
}
<html>
<head>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid vertical-center">
<div class="row justify-content-center task">
<div class="col-auto stop-align-center">
<div class="row">
<div class="col-6">
<input type="text" id="input" />
</div>
</div>
<div class="row" id="wrapper">
<div class="col">
<div class="row"> <!-- not unnecessary because in production there are more rows in parent col! -->
<div class="col">
<div id="progress"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
</body>
</html>
【问题讨论】:
-
添加这个
-
您能再解释一下吗?由于我使用 cdn 导入 jquery,我不知道这个脚本应该来自哪里。另外我会说这是一个CSS问题。该代码在任何其他浏览器中运行良好。我还应该说这只是一个示例代码。在“现实”中,我得到了一个 bootstrap.js,我在其中导入了我用过的小部件。