t***@163.com
t***@163.com
  • 发布:2017-03-07 10:51
  • 更新:2017-03-07 10:57
  • 阅读:1999

【报Bug】scroll和transparent标题栏透明渐变同时存在的时候无法监听到滚动

分类:MUI

详细问题描述
[内容]scroll和transparent标题栏同时存在的时候无法监听到滚动,导致渐变无效,通过修改mui.js里的handleScroll可以解决,此BUG已有多人提出,应用场景广泛,请尽快解决!!!!!

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

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

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

联系方式
[QQ]
[电话]

2017-03-07 10:51 负责人:无 分享
已邀请:

最佳回复

BoredApe

BoredApe - 有问题就会有答案。

  • 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

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