代码之家  ›  专栏  ›  技术社区  ›  matoni

如何在pf6中禁用p:progressBar过渡动画

  •  0
  • matoni  · 技术社区  · 5 年前

    我想 禁用动画 p:progressBar PF 6 . 在PF 7中,可以通过 animationDuration="0" . PF 6有什么解决办法吗?

    0 回复  |  直到 5 年前
        1
  •  1
  •   Melloware    5 年前

    只需将其添加到Javascript中以覆盖ProgressBar并删除动画。

    PF('progress').setValue = function(value) {
            if(value >= 0 && value<=100) {
                if(value == 0) {
                    this.jqValue.hide().css('width', '0%').removeClass('ui-corner-right');
    
                    this.jqLabel.hide();
                }
                else {
                    if(this.cfg.labelTemplate) {
                        var formattedLabel = this.cfg.labelTemplate.replace(/{value}/gi, value);
                        this.jqLabel.text(formattedLabel).show();
                    }
                }
    
                this.value = value;
                this.jq.attr('aria-valuenow', value);
            }
        }