📄 menu.js
字号:
this.SetArrows();
this.sliding = false;
}
}
else
{
this.slideCount -= Math.floor(this.slideStep);
if (this.slideCount < 0)
this.slideStep += this.slideCount;
step = Math.floor(this.slideStep);
for (var i = folder + 1; i <= this.items; i++)
if (document.getElementById("OB_Button" + i).position == "UP")
{
document.getElementById("OB_Button" + i).style.pixelTop += step;
document.getElementById("OB_Folder" + i).style.pixelTop += step;
}
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString = document.getElementById("OB_Folder" + folder).style.clip;
var clip = clipString.match(filter);
this.ClipFolder(folder, parseInt(clip[1]), this.visibleAreaWidth, (parseInt(clip[3]) + step), 0);
var clipString = document.getElementById("OB_Folder" + this.currentFolder).style.clip;
var clip = clipString.match(filter);
this.ClipFolder(this.currentFolder, parseInt(clip[1]), this.visibleAreaWidth, (parseInt(clip[3]) - step), 0);
this.slideStep *= this.slideSpeed;
if (this.slideCount > 0)
setTimeout("OutlookLikeBar.SlideFolders(" + folder + ",false)", 20);
else
{
for (var k = folder + 1; k <= this.items; k++)
document.getElementById("OB_Button" + k).position = "DOWN";
this.currentFolder = folder;
this.SetArrows();
this.sliding = false;
}
}
}
function ItemClicked(item)
{
if (this.sliding)
return;
item.style.border = "1 inset #ffffff";
}
function ItemSelected(item)
{
if (this.sliding)
return;
item.style.border = "1 inset #ffffff";
if (item.link.indexOf("javascript") != -1)
eval(item.link)
else
window.open(item.link, item.targetFrame);
}
function OverItems(item)
{
if (this.sliding)
return;
item.style.border = '1px solid #8BA8C6';
item.style.backgroundColor = '#CEE9FE';
}
function OutItems(item)
{
if (this.sliding)
return;
item.style.border = '0px solid #8BA8C6';
item.style.backgroundColor = '#FFFFFF';
}
function ArrowClicked(arrow)
{
if (this.sliding)
return;
arrow.style.border = "1 inset #ffffff";
}
function ArrowSelected(arrow)
{
if (this.sliding)
return;
arrow.style.border = "0 none black";
this.SlideItems(arrow.id == "OB_SlideUp");
}
function OverArrow(arrow)
{
if (this.sliding)
return;
arrow.style.border = "1 outset #ffffff";
var folder = document.getElementById("OB_Folder" + OutlookLikeBar.currentFolder).style;
var startTop = document.getElementById("OB_Button" + OutlookLikeBar.currentFolder).style.pixelTop + document.getElementById("OB_Button" + OutlookLikeBar.currentFolder).style.pixelHeight;
}
function OutArrow(arrow)
{
if (this.sliding)
return;
arrow.style.border = "0 none black";
}
function ClipFolder(folder, top, right, bottom, left)
{
document.getElementById("OB_Folder" + folder).style.clip = clip = 'rect(' + top + ' ' + right + ' ' + bottom + ' ' + left + ')';
}
function Start()
{
if (!this.started)
{
this.ClipFolder(1, 0, this.visibleAreaWidth, this.visibleAreaHeight, 0);
this.SetArrows();
}
}
function SetArrows()
{
document.getElementById("OB_SlideUp").style.pixelTop = document.getElementById("OB_Button" + this.currentFolder).style.pixelTop + document.getElementById("OB_Button" + this.currentFolder).style.pixelHeight + this.visibleAreaHeight - document.getElementById("OB_SlideDown").height - 20;
document.getElementById("OB_SlideUp").style.pixelLeft = this.width - document.getElementById("OB_SlideUp").width - this.borderWidth - 10;
document.getElementById("OB_SlideDown").style.pixelTop = document.getElementById("OB_Button" + this.currentFolder).style.pixelTop + document.getElementById("OB_Button" + this.currentFolder).style.pixelHeight + 20;
document.getElementById("OB_SlideDown").style.pixelLeft = this.width - document.getElementById("OB_SlideDown").width - this.borderWidth - 10;
var folder = document.getElementById("OB_Folder" + this.currentFolder).style;
var startTop = document.getElementById("OB_Button" + this.currentFolder).style.pixelTop + document.getElementById("OB_Button" + this.currentFolder).style.pixelHeight;
if (folder.pixelTop < startTop)
document.getElementById("OB_SlideDown").style.visibility = "visible";
else
document.getElementById("OB_SlideDown").style.visibility = "hidden";
if (folder.pixelHeight - (startTop - folder.pixelTop) > this.visibleAreaHeight)
document.getElementById("OB_SlideUp").style.visibility = "visible";
else
document.getElementById("OB_SlideUp").style.visibility = "hidden";
}
function HideArrows()
{
document.getElementById("OB_SlideUp").style.visibility = "hidden";
document.getElementById("OB_SlideDown").style.visibility = "hidden";
}
function SlideItems(up)
{
this.sliding = true;
this.slideCount = Math.floor(this.slideArrowValue / this.ArrowSlideSpeed);
up ? this.SlideItemsAction(-this.ArrowSlideSpeed) : this.SlideItemsAction(this.ArrowSlideSpeed);
}
function SlideItemsAction(value)
{
document.getElementById("OB_Folder" + this.currentFolder).style.pixelTop += value;
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString = document.getElementById("OB_Folder" + this.currentFolder).style.clip;
var clip = clipString.match(filter);
this.ClipFolder(this.currentFolder, (parseInt(clip[1]) - value), parseInt(clip[2]), (parseInt(clip[3]) - value), parseInt(clip[4]));
this.slideCount--;
if (this.slideCount > 0)
setTimeout("OutlookLikeBar.SlideItemsAction(" + value + ")", 20);
else
{
if (Math.abs(value) * this.ArrowSlideSpeed != this.slideArrowValue)
{
document.getElementById("OB_Folder" + this.currentFolder).style.pixelTop += (value / Math.abs(value) * (this.slideArrowValue % this.ArrowSlideSpeed));
filter = /rect\((\d*)px (\d*)px (\d*)px (\d*)px\)/;
var clipString = document.getElementById("OB_Folder" + this.currentFolder).style.clip;
var clip = clipString.match(filter);
this.ClipFolder(this.currentFolder, (parseInt(clip[1]) - (value / Math.abs(value) * (this.slideArrowValue % this.ArrowSlideSpeed))), parseInt(clip[2]), (parseInt(clip[3]) - (value / Math.abs(value) * (this.slideArrowValue % this.ArrowSlideSpeed))), parseInt(clip[4]));
}
this.SetArrows();
this.sliding = false;
}
}
function Onwheel()
{
var folder = document.getElementById("OB_Folder" + OutlookLikeBar.currentFolder).style;
var startTop = document.getElementById("OB_Button" + OutlookLikeBar.currentFolder).style.pixelTop + document.getElementById("OB_Button" + OutlookLikeBar.currentFolder).style.pixelHeight;
if (event.wheelDelta >= 120 && folder.pixelTop < startTop)
{
OutlookLikeBar.ArrowSelected(OB_SlideDown);
}
else if (event.wheelDelta <= -120 && folder.pixelHeight - (startTop - folder.pixelTop) > OutlookLikeBar.visibleAreaHeight)
{
OutlookLikeBar.ArrowSelected(OB_SlideUp);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -