📄 global.js
字号:
<!--
//********************************************************************************
//* *
// 功能描述:系统全局公用函数
// 适用版本:博亿网 V1.0
// 初始创建:乔黎明 2003.12.27
// 最后修改:乔黎明 2004.02.24
//* *
//********************************************************************************
//对象:控制“当前位置”
//使用要点:1.清除时调用Initial方法;2.添加时调用Add方法,当locURL为空时,表示当前所在位置,无超链接。
function UserLocation() {
//初始化
this.Initial = function () {
if (typeof(Booye_UserLocation) == "object") Booye_UserLocation.innerHTML = ""
}
//添加新链接
this.Add = function (locName, locURL) {
if (typeof(Booye_UserLocation) != "object") return
if (locName == "") return
if (locURL != "") {Booye_UserLocation.innerHTML += " <span>>></span> <a href='" + locURL + "'>" + locName + "</a>"}
else {Booye_UserLocation.innerHTML += " <span>>></span> " + locName}
}
}
//函数:设置除首页外页面的Title
function SetPageTitle(titleText) {
document.title = titleText + " - " + document.title;
}
/*======即刻显示提示标签代码 开始======*/
//调用示例:<span onmouseover="ShowPrompt('提示文字'); return true;" onmouseout="HidePrompt(); return true;">显示文字</span>
//全局变量
var oPromptDiv, promptOffsetX, promptOffsetY;
promptOffsetX = -2; //设置显示层与鼠标箭头的左间距
promptOffsetY = 19; //设置显示层与鼠标箭头的上间距
//页面装载完成后创建提示区DIV
function CreatePrompt() {
//生成显示层
var qHTML = "<div id=promptDiv style=\"position:absolute; left:0; top:0; display:none; z-index:1; background-color:FFFFE1; border:1 solid #000000; padding: 3 2 0 3\"></div>";
document.body.insertAdjacentHTML("beforeEnd", qHTML);
oPromptDiv = document.all.promptDiv;
//添加鼠标事件
document.onmousemove = MovePrompt;
}
window.attachEvent("onload", CreatePrompt);
//显示提示DIV
function ShowPrompt(showHTML) {
if (typeof(promptDiv)=="object") {
oPromptDiv.innerHTML = showHTML;
oPromptDiv.style.left = event.x+document.body.scrollLeft+promptOffsetX;
oPromptDiv.style.top = event.y+document.body.scrollTop+promptOffsetY;
oPromptDiv.style.display = "block";
}
}
//隐藏提示DIV
function HidePrompt() {
if (typeof(promptDiv)=="object") {
oPromptDiv.style.display = "none";
}
}
//移动提示DIV
function MovePrompt() {
if (typeof(promptDiv)=="object") {
if (oPromptDiv.style.display == "block") {
oPromptDiv.style.left = event.x+document.body.scrollLeft+promptOffsetX;
oPromptDiv.style.top = event.y+document.body.scrollTop+promptOffsetY;
}
}
}
/*======即刻显示提示标签代码 结束======*/
/*======闪烁文字代码 开始======*/
//示例代码:<blink>显示文字</blink>
//执行闪烁动作
function DoBlink() {
var blink = document.all.tags("BLINK");
for (var i=0; i < blink.length; i++) {blink[i].style.visibility = (blink[i].style.visibility=="") ? "hidden" : "";}
}
//初始化闪烁
function StartBlink() {
//Make sure it is IE4
if (document.all) {window.setInterval("DoBlink()",800);}
}
window.onload = StartBlink;
/*======闪烁文字代码 结束======*/
//-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -