Javascript 关闭引导';s进度条上的CSS3转换
有人知道在进度条上禁用引导的CSS3转换的方法吗?我正在通过javascript/jquery更新它们,不想让它们做动画 这看起来很有希望,但无法实现:Javascript 关闭引导';s进度条上的CSS3转换,javascript,jquery,twitter-bootstrap,Javascript,Jquery,Twitter Bootstrap,有人知道在进度条上禁用引导的CSS3转换的方法吗?我正在通过javascript/jquery更新它们,不想让它们做动画 这看起来很有希望,但无法实现: 进度条信息:您可以通过将css转换规则设置为无来关闭转换效果,如下所示: .progress .bar { -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transit
进度条信息:您可以通过将css
转换
规则设置为无
来关闭转换效果,如下所示:
.progress .bar {
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
由于动画来自于
活动的
类,因此您只需使用
$('.progress').removeClass('active');
或
我用javascript解决了这个问题
$('#proc').hide();
$("#proc").width(0 + "%");
$('#proc').show();
对我来说,它工作得很好。不闪烁,只是做它的工作。我想你也可以用纯css来做。你也可以用
$(“.progress bar”)停止。停止()动画,然后重新开始
我想让条形图回到0
,然后重新开始移动到100%
。因此,情况是这样的:
$(".progress-bar").stop(); //Stopping the current animation at the current width
$(".progress-bar").animate({width: "0%"}, 100); //Going back to 0% smoothly in 100ms
$(".progress-bar").animate({width: "100%"}, 1000); //Restarting the process bar to 100%
我希望这会有所帮助。可能很愚蠢,但你不能只编辑CSS并删除对*-transition的引用?就是这样!应该一直在寻找转换属性。谢谢将CSS选择器更改为just.progress bar以禁用Bootstrap 3.0I中的过渡效果,我添加了一个新类,如无过渡
,该样式标记为!重要信息
,这样我就可以有选择地关闭特定进度条。这个问题更多的是关于过渡而不是动画
$(".progress-bar").stop(); //Stopping the current animation at the current width
$(".progress-bar").animate({width: "0%"}, 100); //Going back to 0% smoothly in 100ms
$(".progress-bar").animate({width: "100%"}, 1000); //Restarting the process bar to 100%