参考:类似于仿途牛:/UI2/demo/tuniu/index_main.w
onload事件中实现的效果!
//页面初始化
Model.prototype.modelLoad = function(event){
//页面下拉时页头显示背景颜色
var _this=this;
$(this.comp("homeContent").domNode).scroll(function() {
if($(this).scrollTop()>100){
$(".x-titlebar", _this.getRootNode()).css({"background-color":"rgba(0,0,0,0.8)"});
} else {
$(".x-titlebar", _this.getRootNode()).css({"background-color":"rgba(0,0,0,0)"});
}
});
};
评一波