📄 stm31.js
字号:
{
case "left":
x+=itrc[0]-subrc[2];
y+=itrc[1];
break;
case "up":
x+=itrc[0];
y+=itrc[1]-subrc[3];
if(nIEM)
y+=body.ds_sz;
break;
case "right":
x+=itrc[0]+itrc[2];
y+=itrc[1];
break;
case "down":
x+=itrc[0];
y+=itrc[1]+itrc[3];
break;
case "auto":
default:
break;
}
if(!nOP&&!nNN4)
{
x-=body.ds_sz;
y-=body.ds_sz;
}
return adjust([x,y],body);
}
function adjust(xy,body)
{
var rc=getrect(body);
var tx=xy[0];
var ty=xy[1];
var c_l=getcl();
var c_t=getct();
var c_r=c_l+getcw();
var c_b=c_t+getch();
if(tx+rc[2]>c_r)
tx=c_r-rc[2];
tx=tx>c_l ? tx : c_l;
if(ty+rc[3]>c_b)
ty=c_b-rc[3];
ty=ty>c_t ? ty : c_t;
return [tx,ty];
}
function ckPage()
{
var st_or_w=st_cl_w;
var st_or_h=st_cl_h;
var st_or_l=st_cl_l;
var st_or_t=st_cl_t;
st_cl_w=getcw();
st_cl_h=getch();
st_cl_l=getcl();
st_cl_t=getct();
if((nOP||nNN4)&&(st_cl_w-st_or_w||st_cl_h-st_or_h))
document.location.reload();
else if(st_cl_l-st_or_l||st_cl_t-st_or_t)
setTimeout("scrollmenu();",500);
}
function shitst(it,nst)
{
if(nNN4)
{
var st_lay=get_st_lay(it);
st_lay[nst].visibility="show";
st_lay[1-nst].visibility="hide";
}
else
{
var objs=getlayer(it).style;
if(nIE&&nMac)
{
if(it.background[0]!=it.background[1]) objs.background=it.background[nst];
}
else
{
if(nOP)
objs.background=it.bg_cl[nst];
else
{
if(it.bg_cl[0]!=it.bg_cl[1]) objs.backgroundColor=it.bg_cl[nst];
}
if(it.bg_img[nst]!="")
{
if(it.bg_img[0]!=it.bg_img[1]) objs.backgroundImage="url("+it.bg_img[nst]+")";
if(it.bg_rep[0]!=it.bg_rep[1]) objs.backgroundRepeat=it.bg_rep[nst];
}
}
if(it.bd_cl[0]!=it.bd_cl[1]) objs.borderColor=it.bd_cl[nst];
var tmp;
if(it.icon[0]!=it.icon[1])
{
tmp=getob(it.block+'ICON','IMG');
if(tmp) tmp.src=it.icon[nst];
}
if(it.isimage&&it.image[0]!=it.image[1])
{
tmp=getob(it.block+'IMG','IMG');
if(tmp) tmp.src=it.image[nst];
}
if (!it.txstyle) it.txstyle=getob(it.txblock,'font').style;
tmp=it.txstyle;
if(it.f_fm[0]!=it.f_fm[1]) tmp.fontFamily=it.f_fm[nst];
if(it.f_sz[0]!=it.f_sz[1]) tmp.fontSize=it.f_sz[nst];
if(it.f_wg[0]!=it.f_wg[1]) tmp.fontWeight=it.f_wg[nst];
if(it.f_st[0]!=it.f_st[1]) tmp.fontStyle=it.f_st[nst];
if(it.f_de[0]!=it.f_de[1]) tmp.textDecoration=it.f_de[nst];
if(it.f_cl[0]!=it.f_cl[1])
{
if(nOP) getob(it.block+'MTD','td').style.color=it.f_cl[nst];
else tmp.color=it.f_cl[nst];
}
}
}
function dombov(e,obj,mb)
{
if(nIEW)
{
if(!mb.layer)
mb.layer=obj;
if(!mb.isshow||(e.fromElement&&obj.contains(e.fromElement)))
return;
}
else
{
if(!mb.isshow||(!nNN&&(e.fromElement&&e.fromElement.id&&e.fromElement.id.indexOf(mb.block)>=0)))
return ;
}
if(getme(mb).hdid)
{
clearTimeout(getme(mb).hdid);
getme(mb).hdid=null;
}
}
function dombou(e,obj,mb)
{
if(nIEW)
{
if(!mb.isshow||(e.toElement&&obj.contains(e.toElement)))
return;
}
else
{
if(!mb.isshow||(!nNN&&(e.toElement&&e.toElement.id&&e.toElement.id.indexOf(mb.block)>=0)))
return ;
}
if(getme(mb).hdid)
{
clearTimeout(getme(mb).hdid);
getme(mb).hdid=null;
}
getme(mb).hdid=setTimeout("hideall(st_menus['"+mb.mei+"']);",getme(mb).hddelay);
}
function showpop(body)
{
show(body);
}
function hidepop(body)
{
if(body.curiti>=0)
{
var tmp=getsub(body.items[body.curiti]);
if(tmp&&tmp.isshow)
hidepop(tmp);
shitst(body.items[body.curiti],0);
body.curiti=-1;
}
hide(body);
}
function shitpop(item)
{
if(getsub(item))
{
if(!getsub(item).isshow)
showpop(getsub(item));
}
shitst(item,1);
}
function hditpop(item)
{
if(getsub(item)&&getsub(item).isshow)
hidepop(getsub(item));
shitst(item,0);
}
function hideall(menu)
{
menu.clicked=false;
var body=menu.bodys[0];
if(body.isshow)
{
if(body.curiti>=0)
{
hditpop(body.items[body.curiti]);
body.curiti=-1;
}
if(menu.type=="custom")
hide(body);
}
menu.hdid=null;
}
function setupEvent(menu)
{
for(mbi=0;mbi<menu.bodys.length;mbi++)
{
var body=menu.bodys[mbi];
ly=getlayer(body).document.layers[0];
ly.onmouseover=dombovNN4;
ly.onmouseout=dombouNN4;
for(iti=0;iti<body.items.length;iti++)
{
var item=body.items[iti];
if(item.type!="sepline")
{
ly=getlayer(item).document.layers[0];
ly.onmouseover=doitovNN4;
ly.onmouseout=doitouNN4;
ly.onclick=doitckNN4;
}
}
}
}
function bufimg(sr)
{
if(sr!="")
{
st_buf[st_buf.length]=new Image();
st_buf[st_buf.length-1].src=sr;
return st_buf[st_buf.length-1];
}
return null;
}
function normal_init(body)
{
}
function normal_sh(body)
{
moveto(getxy(body),body);
ck_win_els(-1,body);
_sh(body);
}
function normal_hd(body)
{
_hd(body);
ck_win_els(+1,body);
}
function fade_init(body)
{
body.current=0;
body.step=parseInt(body.opacity*10/(110-body.spec_sp));
if(body.step<=0)
body.step=1;
}
function fade_sh(body)
{
if(body.exec_ed)
{
body.current+=body.step;
if(body.current>body.opacity)
body.current=body.opacity;
}
getlayer(body).filters["Alpha"].opacity=body.current;
if(!body.exec_ed)
{
moveto(getxy(body),body);
ck_win_els(-1,body);
_sh(body);
}
if(body.current!=body.opacity)
body.tmid=setTimeout(get_sdstr(body,true),100);
}
function fade_hd(body)
{
if(body.exec_ed)
{
body.current-=body.step;
if(body.current<0||!body.hdsp)
body.current=0;
}
getlayer(body).filters["Alpha"].opacity=body.current;
if(!body.current)
{
_hd(body);
ck_win_els(+1,body);
}
else
body.tmid=setTimeout(get_sdstr(body,false),100);
}
function filter_init(body)
{
body.fl_type=st_fl[body.spec];
if(body.fl_type==23)
body.fl_type=parseInt(23*Math.random());
body.spec_sp=(body.spec_sp>100 ? 100 : (body.spec_sp<=10 ? 10 : body.spec_sp));
body.duration=10/body.spec_sp;
if(nVer<5.5)
body.spec_string=" revealTrans(Transition="+body.fl_type+",Duration="+body.duration+")";
else
{
body.spec_string=" progid:DXImageTransform.Microsoft."+st_fl_string[body.fl_type];
body.spec_string=body.spec_string.replace(')',',Duration='+body.duration+')');
}
}
function filter_sh(body)
{
if(nVer<5.5)
ft_shx(body);
else if(bFtReg)
eval("try{ft_shx(body);} catch(_err){bFtReg=0;normal_sh(body);}");
else
normal_sh(body);
}
function filter_hd(body)
{
if(nVer<5.5)
ft_hdx(body);
else if(bFtReg)
eval("try{ft_hdx(body);}catch(_err){bFtReg=0;normal_hd(body);}");
else
normal_hd(body);
}
function ft_shx(body)
{
var fl_obj=getlayer(body).filters[0];
if(fl_obj.Status!=0)
fl_obj.stop();
moveto(getxy(body),body);
ck_win_els(-1,body);
fl_obj.apply();
_sh(body);
fl_obj.play();
}
function ft_hdx(body)
{
var fl_obj=getlayer(body).filters[0];
if(fl_obj.Status!=0)
fl_obj.stop();
if(body.hdsp) fl_obj.apply();
_hd(body);
ck_win_els(+1,body);
if(body.hdsp) fl_obj.play();
}
function showFloatMenuAt(nam,x,y)
{
if(nSTMENU)
{
var menu=getMenuByName(nam);
if(menu&&menu.type=="custom"&&menu.bodys.length&&!menu.bodys[0].isshow)
{
movetoex(menu,[x,y]);
show(menu.bodys[0]);
}
}
}
function getMenuByName(nam)
{
return st_menus[eval("sdm_"+nam)];
}
function movetoex(menu,xy)
{
menu.pos_l=xy[0];
menu.pos_t=xy[1];
}
function getcursor(it)
{
return !nNN6&&it.type!="sepline"&&((it.mbi==0&&getme(it).click_sh&&getsub(it))||it.url!="") ? "hand" : "default";
}
function getwdstr(obj)
{
if(getpar(obj).arrange=="vertically")
{
if(getpar(obj).lw_max>0)
return " WIDTH="+getpar(obj).lw_max;
else
return "";
}
else
{
if(obj.icon_w>0)
return " WIDTH="+obj.icon_w;
else
return "";
}
}
function detectNav()
{
var naVer=navigator.appVersion;
var naAgn=navigator.userAgent;
nMac=naVer.indexOf("Mac")>=0;
nOP=naAgn.indexOf("Opera")>=0;
if(nOP)
{
nVer=parseFloat(naAgn.substring(naAgn.indexOf("Opera ")+6,naAgn.length));
nOP5=nVer>=5.12&&!nMac&&naAgn.indexOf("MSIE 5.0")>=0;
}
else
{
nIE=document.all ? 1 : 0;
if(nIE)
{
nIE4=(eval(naVer.substring(0,1)>=4));
nVer=parseFloat(naAgn.substring(naAgn.indexOf("MSIE ")+5,naAgn.length));
nIE5=nVer>=5.0&&nVer<5.5;
nIEM=nIE4&&nMac;
nIEW=nIE4&&!nMac;
}
else
{
nNN4=navigator.appName.toLowerCase()=="netscape"&&naVer.substring(0,1)=="4" ? 1 : 0;
if(!nNN4)
{
nNN6=(document.getElementsByTagName("*") && naAgn.indexOf("Gecko")!=-1);
if(nNN6)
{
nVer=parseInt(navigator.productSub);
if(naAgn.indexOf("Netscape")>=0)
{
bDelBorder=nVer<20001108+1;
bAddBorder=nVer>20020512-1;
}
else
{
bDelBorder=nVer<20010628+1;
bAddBorder=nVer>20011221-1;
}
}
}
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -