header元素改成<header id="header" class="mui-bar mui-bar-transparent" data-transparent=".mui-content">就可以了。
如果.mui-content有轮播图的话会触发scroll事件,y值为0,导致header又变成透明,故Transparent.prototype.handleScroll方法要改成以下  
Transparent.prototype.handleScroll = function(e) {  
        var y = window.scrollY;  
        if (!this.isNativeScroll && e && e.detail) {  
          if(e.detail.direction){  
            //不是由滚动条滚动触发的scroll事件暂不做处理  
            y = -e.detail.y;  
          }else{  
            return;  
          }  
        }  
        var opacity = (y - this.options.top) / this.options.offset + this._A;  
        opacity = Math.min(Math.max(this._A, opacity), 1);  
        this._style.backgroundColor = 'rgba(' + this._R + ',' + this._G + ',' + this._B + ',' + opacity + ')';  
        if (opacity > this._A) {  
            this.element.classList.add(CLASS_ACTIVE);  
        } else {  
            this.element.classList.remove(CLASS_ACTIVE);  
        }  
        if (this.lastOpacity !== opacity) {  
            $.trigger(this.element, 'alpha', {  
                alpha: opacity  
            });  
            this.lastOpacity = opacity;  
        }  
    };
                                        
                                     
h***@sina.com (作者)
您好,尝试增加了mui-bar-nav,透明渐变依然未生效
看了一下,mui-bar-nav主要就是对mui-content增加了padding-top: 44px; 属性;对header增加了top:0;没有js的处理
我是仿照examples/nav_transparent.html的header写的
2016-06-13 02:56
h***@sina.com (作者)
您好,增加mui-scroll-warpper和mui-scroll之后,
Transparent.prototype.handleScroll 这个函数中window.scrollY一直为0,不知道是什么原因
2016-06-13 03:01
距离您98米
回复 h***@sina.com:解决了吗?
2017-07-25 17:36