详细问题描述
[内容]scroll和transparent标题栏同时存在的时候无法监听到滚动,导致渐变无效,通过修改mui.js里的handleScroll可以解决,此BUG已有多人提出,应用场景广泛,请尽快解决!!!!!
重现步骤
[步骤]
[结果]
[期望]
运行环境
[系统版本]
[浏览器版本]
[IDE版本]
[mui版本]
附件
[代码片段]
[安装包]
联系方式
[QQ]
[电话]
详细问题描述
[内容]scroll和transparent标题栏同时存在的时候无法监听到滚动,导致渐变无效,通过修改mui.js里的handleScroll可以解决,此BUG已有多人提出,应用场景广泛,请尽快解决!!!!!
重现步骤
[步骤]
[结果]
[期望]
运行环境
[系统版本]
[浏览器版本]
[IDE版本]
[mui版本]
附件
[代码片段]
[安装包]
联系方式
[QQ]
[电话]
最佳回复
BoredApe - 有问题就会有答案。
请阅读文档:http://dev.dcloud.net.cn/mui/ui/#transparentBar
可设置scrollby属性指定滚动监听容器
!!! 此功能 在MUI V 3.5+ 才支持,请确认版本号
t***@163.com (作者)
没有用,你们自己可以测试一下!
2017-03-07 11:44
t***@163.com (作者)
我已经是3.6版了,不管用domAPI还是jsAPI都没用
2017-03-07 11:46
t***@163.com (作者)
但是用以下方法就可行:
修改 mui.js
Transparent.prototype.handleScroll = function() {
if(this.options.scroll === "undefined") {
this._style.backgroundColor = 'rgba(' + this._R + ',' + this._G + ',' + this._B + ',' + (window.scrollY - this.options.top) / this.options.offset + ')';
} else {
//writeObj(this.options);
console.log(this.options.scroll.y);
// console.log('rgba(' +this._R +','+ this._G +',' +this._B +','+ (this.options.top - this.options.scroll.y) / this.options.offset +')');
this._style.backgroundColor = 'rgba(' + this._R + ',' + this._G + ',' + this._B + ',' + (this.options.top - this.options.scroll.y) / this.options.offset + ')';
}
};
然后初始化 执行
var scrolls = mui('.mui-scroll-wrapper').scroll({});
mui('.mui-bar-transparent').transparent({
scroll:scrolls, // mui-scroll-wrapper是array就记得写下标
offset: 150
});
2017-03-07 11:47
距离您98米
回复 t***@163.com:出现双滚动条, 怎么解决?
2017-07-25 14:56