//****************************************************
// TaskMenu 3.0
// 静静的黎明
// http://www.docode.cn
//****************************************************
/////////////////////////////////////////////////////////////////////////////////
var INF_IS_IEXPLORER = (navigator.userAgent.indexOf("MSIE") == -1)? false : true;
var INF_IS_MENU_BEHAVIOR_AUTO = true;
var INF_IS_SCROLLBAR_ENABLED = false;
///////////////////////////////////////////////////////
/////////////*** CONFIG ***////////////////////////////
var CFG_FRAME_COUNT = 6;
var CFG_DOCUMENT_MARGIN = 12;
var CFG_MENU_SPACING = 15;
var CFG_MENU_WIDTH = 185;
var CFG_SCROLLBAR_WIDTH = 17;
var CFG_TITLEBAR_HEIGHT = 25;
var CFG_TITLEBAR_LEFT_WIDTH = 13;
var CFG_TITLEBAR_RIGHT_WIDTH = 25;
var CFG_TITLEBAR_MIDDLE_WIDTH = CFG_MENU_WIDTH - CFG_TITLEBAR_LEFT_WIDTH - CFG_TITLEBAR_RIGHT_WIDTH;
var CFG_TITLEBAR_BORDER_WIDTH = 0;
var CFG_MENUBODY_PADDING = 9;
var CFG_MENUBODY_BORDER_WIDTH = 1;
var CFG_SLEEP_TIME_BEGIN = 20;
var CFG_SLEEP_TIME_END = 60;
var CFG_ALPHA_STEP = Math.ceil( 100 / (CFG_FRAME_COUNT) );
var CFG_IS_SCROLLBAR_ENABLED = true;
var CFG_IS_SPECIAL_HEAD_NODE = false;
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
if(new Array().push == null)
{
//usage: array.push(Array); for ie5.0
Array.prototype.push = function()
{
this[this.length] = arguments[0];
return this.length;
}
}
if(new Array().splice == null)
{
/// usage: array.splice(startPos,deleteCount,[item1,item2,...]);for ie5.0
Array.prototype.splice = function()
{
if(arguments.length < 2 || arguments[1] < 0)
return new Array();
var endPoint1 = arguments[0];
if(endPoint1 < 0 && Math.abs(endPoint1) > this.length)
endPoint1 = 0;
var startPoint2 = (endPoint1 < 0)? (this.length + endPoint1 + arguments[1]) : (endPoint1 + arguments[1]);
var bArray = this.slice(0,endPoint1);
var dArray = this.slice(endPoint1,startPoint2);
var eArray = this.slice(startPoint2);
var nArray = new Array();
for(var i = 2; i < arguments.length; i++)
{
nArray.push(arguments[i]);
}
var fArray = bArray.concat(nArray,eArray);
for(var i = 0; i < fArray.length; i++)
{
this[i] = fArray[i];
}
this.length = fArray.length;
return dArray;
}
}
/////////////////////////////////////////////////////////////////
function TaskMenuState(){}
TaskMenuState.uninited = 0;
TaskMenuState.open = 1;
TaskMenuState.close = 2;
TaskMenuState.opening = 4;
TaskMenuState.closing = 8;
TaskMenuState.transforming = 16;
function TaskMenuItem(strLabel,strIcon,strCommand)
{
this.label = strLabel;
this.icon = strIcon;
this.command = strCommand;
this.hItem = null;
this.hLabel = null;
this.hIcon = null;
this.hLabelCell = null;
this.container = null;
this.operTimer = null;
this.tranTimer = null;
this.operStep = 0;
this.tranStep = 0;
this.operCount = 0;
this.tranCount = 0;
this.init = function()
{
(this.hLabel = document.createElement("FONT")).reflectClass = this;
with(this.hLabel)
{
reflectClass = this;
}
with(this.hItem = document.createElement("TABLE"))
{
cellPadding = 0;
cellSpacing = 0;
style.width = "100%";
}
(itemRow = this.hItem.insertRow(0)).className="MenuItemRow";
with(blankCell = itemRow.insertCell(0))
{
style.width = (CFG_MENUBODY_PADDING - 2) +"px";
}
with(iconCell = itemRow.insertCell(1))
{
align = "RIGHT";
style.cssText = "width:18px;vertical-align:top;padding-top:3px";
with(this.hIcon = iconCell.appendChild(document.createElement("DIV")))
{
className = "IconContainer";
}
}
with(this.hLabelCell = itemRow.insertCell(2))
{
style.padding = "2px " + CFG_MENUBODY_PADDING +"px 2px 5px";
appendChild(this.hLabel);
}
with(this)
{
setIcon(icon); setLabel(label); setCommand(command);
}
}
this.getLabel = function()
{
return this.label;
}
this.setLabel = function(strLabel)
{
this.hLabel.innerHTML = this.label = strLabel;
}
this.getIcon = function()
{
return this.icon;
}
this.setIcon = function(strIcon)
{
this.icon = strIcon;
while(this.hIcon.firstChild != null)
{
this.hIcon.removeChild(this.hIcon.firstChild);
}
if(this.icon != null)
{
with(this.hIcon)
{
style.width = "18px";
parentNode.style.width = "18px";
with(appendChild(new Image()))
{
src= this.icon;
}
}
}
else
{
this.hIcon.style.width = "0px";
this.hIcon.parentNode.style.width = "0px";
}
}
this.getCommand = function()
{
return this.command;
}
this.setCommand = function(strCommand)
{
if( (this.command = strCommand) != null)
{
JS.addListener(this.hLabel,"mouseover",TaskMenuItem.onMouseBehavior,false);
JS.addListener(this.hLabel,"mouseout",TaskMenuItem.onMouseBehavior,false);
JS.addListener(this.hLabel,"click",TaskMenuItem.onClick,false);
this.hLabel.className = "MenuItemLabel";
}
else
{
JS.removeListener(this.hLabel,"mouseover",TaskMenuItem.onMouseBehavior,false);
JS.removeListener(this.hLabel,"mouseout",TaskMenuItem.onMouseBehavior,false);
JS.removeListener(this.hLabel,"click",TaskMenuItem.onClick,false);
this.hLabel.className = "MenuItemLabelDisabled";
}
}
this.runCommand = function()
{
try
{
eval(this.command);
}
catch(ex)
{
alert("Javascript Error:" + ex.description);
}
}
this.cloneNode = function()
{
return new TaskMenuItem(this.label,this.icon,this.command);
}
this.init();
}
TaskMenuItem.onMouseBehavior = function()
{
with(JS.getSourceElement(arguments[0]))
{
if(arguments[0].type.toUpperCase() == "MOUSEOVER")
className = "MenuItemLabelMouseOver";
else
className = "MenuItemLabel";
}
}
TaskMenuItem.onClick = function()
{
var refClass = JS.getSourceElement(arguments[0]).reflectClass;
if(refClass != null) refClass.runCommand();
}
function TaskMenu(strLabel,menuState)
{
this.menuID;
this.label = strLabel;
this.state = menuState;
this.items = [];
this.hLabel = null;
this.hArrayCell = null;
this.titlebar = null;
this.menuBody = null;
this.previous = null;
this.next = null;
this.background = null;
this.operationTimer;
this.transformTimer;
this.invalidateTimer
this.operationStep;
this.transformStep;
this.operationSleep;
this.transformSleep;
this._getAlphaOpacity = function()
{
try
{
if(INF_IS_IEXPLORER)
return this.menuBody.filters.alpha.opacity;
else
return this.menuBody.style.MozOpacity * 100;
}
catch(ex)
{
return 100;
}
}
this._setAlphaOpacity = function(n)
{
try
{
if(INF_IS_IEXPLORER)
this.menuBody.filters.alpha.opacity = n;
else
this.menuBody.style.MozOpacity = n / 100;
}
catch(ex)
{}
}
this._clearItem = function()
{
for(var i =0; i< this.items.length; i++)
{
this.items[i].container = null;
}
this.items = new Array();
}
this._clearMenu = function()
{
if(this.menuBody == null) return;
while(this.menuBody.firstChild != null)
this.menuBody.removeChild(this.menuBody.firstChild);
}
this._setMenuFixed = function(bFlag)
{
if(this.menuBody == null) return;
if(bFlag == true)
{
this.menuBody.style.overflow = "hidden";
}
else
{
this.menuBody.style.overflow = "visible";
this.menuBody.style.height = "auto";
}
}
this._setMenuHeight
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
TaskMenu30.zip (33个子文件)
TaskMenu3.0
Image
dload.gif 102B
bg.gif 425B
friends.gif 320B
list.gif 623B
mslogo.gif 628B
demo.gif 127B
api.gif 169B
copy.gif 239B
update.gif 660B
Silver
TitlebarLeft_Head.gif 125B
silverStyle.css 3KB
TitlebarRight.gif 1KB
TitlebarLeft.gif 99B
TitlebarMiddle_Head.gif 667B
TitlebarMiddle.gif 630B
TitlebarRight_Head.gif 2KB
TaskMenu.js 26KB
Classic
titlebarRight.gif 234B
titlebarMiddle.gif 58B
titlebarMiddle_Head.gif 58B
titlebarLeft.gif 56B
classicStyle.css 3KB
titlebarLeft_Head.gif 56B
titlebarRight_Head.gif 230B
Blue
titlebarMiddle.gif 353B
TitlebarRight.gif 2KB
titlebarMiddle_Head.gif 410B
BlueStyle.css 3KB
titlebarLeft.gif 59B
titlebarLeft_Head.gif 122B
TitlebarRight_Head.gif 2KB
WebMain
TaskMenu.aspx 546B
TaskMenu.aspx.cs 6KB
共 33 条
- 1
xlfancy
- 粉丝: 3
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页