?? dw_posrel.js
字號:
/*
dw_posrel.js
contains posRel method for dynObj
adapted from cross-browser.com - Mike Foster
This code is from Dynamic Web Coding
at http://www.dyn-web.com/
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code
as long as this entire notice is included.
*/
// position layer in window or containing layer
dynObj.prototype.posRel = function(loc,mar,container) {
if (!container) {
cWd = getWinWidth();
cHt = getWinHeight();
} else {
cWd = container.width;
cHt = container.height;
}
switch (loc) {
case "nw" :
x = mar; y = mar;
break;
case "n":
x = Math.round((cWd-this.width)/2);
y = mar;
break;
case "ne" :
x = cWd-this.width-mar;
y = mar;
break;
case "w" :
x = mar;
y = Math.round((cHt-this.height)/2);
break;
case "c" :
x = Math.round((cWd-this.width)/2);
y = Math.round((cHt-this.height)/2);
break;
case "e" :
x = cWd-this.width-mar;
y = Math.round((cHt-this.height)/2);
break;
case "sw" :
x = mar;
y = cHt-this.height-mar;
break;
case "s" :
x = Math.round((cWd-this.width)/2);
y = cHt-this.height-mar;
break;
case "se" :
x = cWd-this.width-mar;
y = cHt-this.height-mar;
break;
default :
alert("Wrong position chosen!")
break;
}
this.leftPos = x;
this.topPos = y;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -