如何使用javascript更改progressbar背景色

如何使用javascript更改progressbar背景色,javascript,ext.net,Javascript,Ext.net,我正在寻找如何使用JavaScript更改ext.net progressbar的背景色。可能会从JavaScript向progressbar添加CSS类 我尝试添加css类,但失败了。事实上,我找不到可以帮助我添加CSS类的函数 任何帮助都将不胜感激 编辑: function ShowProgressBar(progressBar, progressValue, message) { progressBar.show(); progressBa

我正在寻找如何使用JavaScript更改ext.net progressbar的背景色。可能会从JavaScript向progressbar添加CSS类

我尝试添加css类,但失败了。事实上,我找不到可以帮助我添加CSS类的函数

任何帮助都将不胜感激

编辑:

 function ShowProgressBar(progressBar, progressValue, message) {
            progressBar.show();
            progressBar.updateProgress(progressValue, message);
//need to add the css class here something like progressBar.addClass('green-bar')
        }
    .green-bar{
        background:#008000;
}
   .green-bar .x-progress-bar{
        background:#008000;
}
progressBar.addClass('green-bar'); //obviously i have removed the added css class after use.
javascript:

 function ShowProgressBar(progressBar, progressValue, message) {
            progressBar.show();
            progressBar.updateProgress(progressValue, message);
//need to add the css class here something like progressBar.addClass('green-bar')
        }
    .green-bar{
        background:#008000;
}
   .green-bar .x-progress-bar{
        background:#008000;
}
progressBar.addClass('green-bar'); //obviously i have removed the added css class after use.
CSS:

 function ShowProgressBar(progressBar, progressValue, message) {
            progressBar.show();
            progressBar.updateProgress(progressValue, message);
//need to add the css class here something like progressBar.addClass('green-bar')
        }
    .green-bar{
        background:#008000;
}
   .green-bar .x-progress-bar{
        background:#008000;
}
progressBar.addClass('green-bar'); //obviously i have removed the added css class after use.

您可以添加调用

选中此项
阅读此文档可以帮助您伙计们,我已经解决了这个问题。只需要更改CSS类名

CSS:

 function ShowProgressBar(progressBar, progressValue, message) {
            progressBar.show();
            progressBar.updateProgress(progressValue, message);
//need to add the css class here something like progressBar.addClass('green-bar')
        }
    .green-bar{
        background:#008000;
}
   .green-bar .x-progress-bar{
        background:#008000;
}
progressBar.addClass('green-bar'); //obviously i have removed the added css class after use.
JavaScript:

 function ShowProgressBar(progressBar, progressValue, message) {
            progressBar.show();
            progressBar.updateProgress(progressValue, message);
//need to add the css class here something like progressBar.addClass('green-bar')
        }
    .green-bar{
        background:#008000;
}
   .green-bar .x-progress-bar{
        background:#008000;
}
progressBar.addClass('green-bar'); //obviously i have removed the added css class after use.

谢谢,我明白了。但请不要介意,你可以给我看一个ext.net示例而不是extjs。事实上,我不使用ext,但我知道我通过HTML DOM操作应用样式。