简体   繁体   English

更改2进度条的过渡和样式

[英]Change transition and style for 2 progress bar

I'm using bootstrap progress bar to show the progress of loading data, the problem is i have 2 progress bar i want to merge as one (same div class), the first progress bar only appear when first page load and after data comes in the first progress bar i set to hide and the second progress bar i set to show, but the transition animation between hide and show this 2 progress bar is not smooth, i want to make the progress bar as 1 div so the 2nd progress bar will 我正在使用引导进度条来显示加载数据的进度,问题是我有2个进度条,我想将其合并为一个(相同的div类),仅当第一页加载时和数据输入后才出现第一个进度条我将第一个进度条设置为隐藏,将第二个进度条设置为显示,但是隐藏和显示这2个进度条之间的过渡动​​画并不平滑,我想将进度条设置为1 div,因此第二个进度条将

here's the progress bar html code : 这是进度条html代码:

<div id="progress2nd" class="progress" style="height:25px; background:transparent;"></div>
<div id="progress1st" class="progress-bar progress-bar-warning progress-bar-striped active" role="progressbar" aria-valuenow="'+totalPct+'" aria-valuemin="0" aria-valuemax="100" style="width:100%"> Loading Data (0.0%)</div>

here's the jquery code: 这是jQuery代码:

$("#progress1st").hide(200);
$("#progress2nd").html('<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="'+totalPct+'" aria-valuemin="0" aria-valuemax="100" style="width:' + totalPct + '%">'+'Loading Data ('+totalPct.toFixed(1)+'%)'+'</div>');

Try this : remove transition time of hiding a div 试试这个:删除隐藏div的过渡时间

change $("#progress1st").hide(200); 更改$("#progress1st").hide(200); to $("#progress1st").hide(); $("#progress1st").hide();

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

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