|
发表于 2014-3-6 11:01:44
|
显示全部楼层
修改 /UI/portal2/process/portal/components/all3.js 文件中的
ScrollBar.prototype = {
init
方法
this.el.empty();
this.el.append('<a class="prev icon icon-system-left-open" href="#"></a>');
this.el.append('<a class="next icon icon-system-right-open" href="#"></a>');
//在首页标签的位置,增加一级菜单
this.el.append('<div class="wrap"><ul class="fixed"><li class="topDir" style="float:left"></li></ul><div class="other"><ul></ul></div></div>');
this.fixedULEl = $('.fixed', this.el);
this.ulEl = $('.wrap .other ul', this.el);
this.ulEl.disableSelection();
//初始化一级菜单
this.topDir = $('.topDir', this.el);
var select = $("<select></select>");
this.items.each(function(item){
if(!item.fixed){
option = $("<option value='"+item.index+"'>"+item.label+"</option>");
select.append(option);
}
});
select.click((function(items){
return function(){
me.ulEl.empty();
var dirIndex = parseInt($(this).val()) + 1;
$.each(items[dirIndex].childNodes, function(i,item){
me.doAdd(item);
});
};
})(this.items.items));
this.topDir.append(select);
//初始化首页标签
this.items.each(function(item){
if(item.fixed)
me.doAdd(item);
});
//重新计算一级菜单下拉框和首页标签的宽度
$('.wrap .other', this.el).css({marginLeft: this.fixedULEl.width()});
//屏蔽原来的初始化一级目录
/*this.items.each(function(item){
if(!item.fixed)
me.doAdd(item);
});*/
all3.js
(75.39 KB, 下载次数: 229)
|
|