📄 newmenu-job.js
字号:
var g_openMenu = null;
var g_timer;
var g_area1Previous = "part1_1",g_area2Previous = "part2_1";
function $id(id){
return document.getElementById(id);
}
function showMenu(parentObj,childId){
if (g_openMenu != null && g_openMenu != childId)
{
clearTimeout(g_timer);
$id(g_openMenu).style.display = "none";
g_openMenu = null;
return;
}
if (g_openMenu == childId)
{
clearTimeout(g_timer);
return;
}
var obj = document.getElementById(parentObj);
var parentPos = getParentXY(obj);
//alert("X="+parentPos[0]+","+"Y="+parentPos[1]);
$id(childId).style.left = parentPos[0]+"px";
$id(childId).style.top = parentPos[1]+25+"px";
$id(childId).style.display = "block";
g_openMenu = childId;
}
function getParentXY(obj)
{
var parentX = obj.offsetLeft;
var parentY = obj.offsetTop;
while (obj = obj.offsetParent)
{
parentX += obj.offsetLeft;
parentY += obj.offsetTop;
}
var parentPos = [parentX,parentY];
return parentPos;
}
function hideMenu(childId){
g_timer = setTimeout(function(){hideNow(childId)},1);
}
function hideNow(childId){
$id(childId).style.display = "none";
g_openMenu = null;
}
function chgTab(areaNumber,tabNumber){
if (areaNumber == "area1")
{
$id(g_area1Previous).className = "product_tab_unselect";
$id(g_area1Previous+"_content").className = "product_unselect";
$id(tabNumber).className = "product_tab_select";
$id(tabNumber+"_content").className = "product_select";
g_area1Previous = tabNumber;
}
else
{
$id(g_area2Previous).className = "indi_tab_unselect";
$id(g_area2Previous+"_content").className = "qq_unselect";
$id(tabNumber).className = "indi_tab_select";
$id(tabNumber+"_content").className = "qq_select";
g_area2Previous = tabNumber;
}
}
function CheckForm()
{
if(document.form1.keyword.value=="")
{
alert("请输入查询关键字!");
document.form1.keyword.focus();
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -