jntoo
jntoo
  • 发布:2017-03-11 11:54
  • 更新:2017-03-11 11:54
  • 阅读:1495

【报Bug】mui-slider 左右切换中间不动

分类:MUI

详细问题描述
mui.js
mtabsegmented div选项卡,当上级元素有display:none 先隐藏在显示出来后会出现BUG,蓝色下滑线不会跟着动。

代码修复如下:
在 4835 行 setTranslate 方法


setTranslate: function(x, y) {  
            this._super(x, y);  
            var progressBar = this.progressBar;  

            if (progressBar) {  
                this.progressBarStyle.webkitTransform = this._getTranslateStr((-x * (this.progressBarWidth / this.wrapperWidth)), 0);  
                //console.log(this._getTranslateStr((-x * (this.progressBarWidth / this.wrapperWidth)), 0));  
            }  
        },  

改成如下:

setTranslate: function(x, y) {  
            this._super(x, y);  
            var progressBar = this.progressBar;  

            if (progressBar) {  
                if(!this.progressBarWidth){  
                    this.progressBarWidth = this.progressBar.offsetWidth;  
                }  

                this.progressBarStyle.webkitTransform = this._getTranslateStr((-x * (this.progressBarWidth / this.wrapperWidth)), 0);  
                //console.log(this._getTranslateStr((-x * (this.progressBarWidth / this.wrapperWidth)), 0));  
            }  
        }  

重现步骤
[步骤]
[结果]
[期望]

运行环境
[系统版本]
[浏览器版本]
[IDE版本]
[mui版本]

附件
[代码片段]
[安装包]

联系方式
[QQ]
[电话]

2017-03-11 11:54 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复