엠

가운데 정렬된 홈페이지에서 따라다니는 레이어

· 2006-12-15 (금) 12:10:10 · 3192
<html>
<head>
<title>가운데 정렬된 홈페이지에서 따라다니는 레이어</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function flevDivPositionValue(sDiv, sProperty) { // v2.1, Marja Ribbers-de Vroed, FlevOOware
this.opera = (window.opera); // Opera 5+
this.ns4 = (document.layers); // Netscape 4.x
this.ns6 = (document.getElementById && !document.all && !this.opera); // Netscape 6+
this.ie = (document.all); // Internet Explorer 4+
var sValue = ""; docObj = eval("MM_findObj('" + sDiv + "')"); if (docObj == null) {return 0;}
if ((sProperty == "left") || (sProperty == "top")) {
if (!this.ns4) {docObj = docObj.style;}
sValue = eval("docObj." + sProperty);
if ((this.ie) && (sValue == "")) { // IE (on PC) bug with nested layers
if (sProperty == "top") { sValue = eval(sDiv + ".offsetTop"); }
else { sValue = eval(sDiv + ".offsetLeft"); }
};
}
else {
if (this.opera) {
docObj = docObj.style;
if (sProperty == "height") { sValue = docObj.pixelHeight; }
else if (sProperty == "width") { sValue = docObj.pixelWidth; }
}
else if (this.ns4) {sValue = eval("docObj.clip." + sProperty);}
else if (this.ns6) {sValue = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(sProperty); }
else if (this.ie) {
if (sProperty == "width") { sValue = eval(sDiv + ".offsetWidth"); }
else if (sProperty == "height") { sValue = eval(sDiv + ".offsetHeight"); }
}
}
sValue = (sValue == "") ? 0 : sValue;
if (isNaN(sValue)) { if (sValue.indexOf('px') > 0) { sValue = sValue.substring(0,sValue.indexOf('px')); } }
return parseInt(sValue);
}

function flevPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
var sD = arguments[0], oD = eval("MM_findObj('" + sD + "')"), iWW, iWH, iSX, iSY, iT = 10, sS = "";
if (!document.layers) {oD = oD.style;}
if (oD.tmpTimeout != null) {clearTimeout(oD.tmpTimeout);}
var sXL = arguments[1], sXC = arguments[2], sXR = arguments[3], sYT = arguments[4], sYC = arguments[5], sYB = arguments[6];
var iS = (arguments.length > 7) ? parseInt(arguments[7]) : 0, iPx = (arguments.length > 8) ?
parseInt(arguments[8]) : 0;
if (window.innerWidth) { // NS4, NS6 and Opera
var oW = window; iWW = oW.innerWidth; iWH = oW.innerHeight; iSX = oW.pageXOffset; iSY = oW.pageYOffset; }
else if (document.documentElement && document.documentElement.clientWidth) { // IE6 instandards compliant mode
var oDE = document.documentElement; iWW = oDE.clientWidth; iWH = oDE.clientHeight; iSX = oDE.scrollLeft; iSY = oDE.scrollTop; }
else if (document.body) { // IE4+
var oDB = document.body; iWW = oDB.clientWidth; iWH = oDB.clientHeight; iSX = oDB.scrollLeft; iSY = oDB.scrollTop; }
else {return;}
var iCX = iNX = flevDivPositionValue(sD, 'left'), iCY = iNY = flevDivPositionValue(sD, 'top'); if (sXL != "") {iNX = iSX + parseInt(sXL);}
else if (sXC != "") {iNX = Math.round(iSX + (iWW/2) - (flevDivPositionValue(sD, 'width')/2));}
else if (sXR != "") {iNX = iSX + iWW - (flevDivPositionValue(sD, 'width') + parseInt(sXR));}
if (sYT != "") {iNY = iSY + parseInt(sYT);}
else if (sYC != "") {iNY = Math.round(iSY + (iWH/2) - (flevDivPositionValue(sD, 'height')/2));}
else if (sYB != "") {iNY = iSY + (iWH - flevDivPositionValue(sD, 'height') - parseInt(sYB));}
if ((iCX != iNX) || (iCY != iNY)) {
if (iS > 0) {
if (iPx > 0) { iT = iS;
var iPxX = iPx, iPxY = iPx, iMX = Math.abs(iCX - iNX), iMY = Math.abs(iCY - iNY);
// take care of diagonal movement
if (iMX < iMY) {iPxY = (iMX != 0) ? ((iMY/iMX)*iPx) : iPx;}
else {iPxX = (iMY != 0) ? ((iMX/iMY)*iPx) : iPx;}
if (iPxX >= iMX) {iPxX = Math.min(Math.ceil(iPxX), iPx);}
if (iPxY >= iMY) {iPxY = Math.min(Math.ceil(iPxY), iPx);}
// temporary X/Y coordinates
if ((iCX < iNX) && (iCX + iPxX < iNX)) {iNX = iCX + iPxX;}
if ((iCX > iNX) && (iCX - iPxX > iNX)) {iNX = iCX - iPxX;}
if ((iCY < iNY) && (iCY + iPxY < iNY)) {iNY = iCY + iPxY;}
if ((iCY > iNY) && (iCY - iPxY > iNY)) {iNY = iCY - iPxY;} }
else {
var iMX = ((iNX - iCX) / iS), iMY = ((iNY - iCY) / iS);
iMX = (iMX > 0) ? Math.ceil(iMX) : Math.floor(iMX); iNX = iCX + iMX;
iMY = (iMY > 0) ? Math.ceil(iMY) : Math.floor(iMY); iNY = iCY + iMY; } }
if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) &&
(!window.opera)) {sS="px";}
if (iMX != 0) {eval("oD.left = '" + iNX + sS + "'");}
if (iMY != 0) {eval("oD.top = '" + iNY + sS + "'");} }
var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC
+ "','" + sYB + "'," + iS + "," + iPx + ")";
oD.tmpTimeout = setTimeout(sF,10);
}

function flevInitPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
if (arguments.length < 8) {return;}
var sD = arguments[0]; if (sD == "") {return;}
var oD = eval("MM_findObj('" + sD + "')"); if (!oD) {return;}
var iCSS = parseInt(arguments[1]);
var sXL = arguments[2], sXC = arguments[3], sXR = arguments[4], sYT = arguments[5], sYC =
arguments[6], sYB = arguments[7];
var iS = (arguments.length > 8) ? parseInt(arguments[8]) : 0, iPx = (arguments.length > 9) ?
parseInt(arguments[9]) : 0;
if (iCSS != 0) { if (!document.layers) {oD = oD.style;} sXL = parseInt(oD.left), sYT =
parseInt(oD.top);}
var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC
+ "','" + sYB + "'," + iS + "," + iPx + ")";
eval(sF);
}
//-->
</script>
</head>
<body onLoad="flevInitPersistentLayer('Layer1','0','','','','10','','','10');">

<div id="Layer1" style="background-color:rgb(204,204,51); border-width:1px; border-color:black; border-style:none; width:142px; height:317px; position:relative; left:50px; top:60px; z-index:1; left:expression( (document.body.clientWidth/2)+250); layer-background-color:rgb(204,204,51); ">ㅎㅎㅎ</div>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
07-10-13 조회 5,110
07-10-03 조회 4,102
07-10-03 조회 3,291
07-10-03 조회 2,513
07-10-03 조회 4,612
07-10-02 조회 2,950
07-10-01 조회 3,576
07-09-28 조회 3,496
07-09-27 조회 4,553
07-08-16 조회 6,405
07-08-04 조회 2,855
07-07-25 조회 6,108
07-07-05 조회 4,002
07-07-02 조회 4,548
07-06-30 조회 4,447
07-06-20 조회 7,336
07-06-20 조회 3,947
07-06-05 조회 4,117
07-05-26 조회 3,151
07-05-17 조회 9,152
07-05-17 조회 5,196
07-05-04 조회 6,117
07-04-15 조회 6,202
07-04-13 조회 3,974
07-04-11 조회 3,386
07-03-20 조회 3,560
07-03-02 조회 6,786
07-02-27 조회 6,052
07-02-22 조회 4,444
07-01-30 조회 6,255
07-01-30 조회 1만
06-12-20 조회 3,728
06-12-18 조회 4,604
06-12-15 조회 4,584
06-12-15 조회 3,811
06-12-15 조회 3,197
06-11-30 조회 3,639
06-11-27 조회 4,534
06-10-24 조회 6,442
06-10-17 조회 4,752
06-09-22 조회 4,486
06-09-21 조회 5,993
06-09-21 조회 3,919
06-09-15 조회 6,535
06-08-20 조회 3,680
06-07-19 조회 3,322
06-07-14 조회 4,223
06-07-14 조회 4,090
06-07-11 조회 5,699
06-06-08 조회 4,276
06-06-08 조회 4,189
06-05-24 조회 3,504
06-05-24 조회 4,886
06-05-17 조회 3,596
06-05-16 조회 4,348
06-05-14 조회 6,044
06-05-12 조회 3,602
06-05-06 조회 4,252
06-05-06 조회 4,333
06-05-06 조회 3,631
06-05-06 조회 3,704
06-05-06 조회 4,152
06-04-25 조회 4,018
06-03-23 조회 5,475
06-01-20 조회 4,046
06-01-04 조회 4,254
05-12-30 조회 4,126
05-12-21 조회 4,799
05-11-09 조회 4,007
05-11-09 조회 3,790
05-10-09 조회 3,452
05-09-21 조회 6,840
05-08-14 조회 4,324
05-08-04 조회 5,503
05-07-14 조회 4,559
05-06-15 조회 4,954
05-04-23 조회 4,556
05-04-20 조회 5,013
05-04-19 조회 1.1만
05-04-19 조회 5,972
05-03-15 조회 3,789
05-03-15 조회 4,231
05-03-13 조회 2,906
05-03-13 조회 3,433
05-03-13 조회 3,420
05-03-13 조회 2,724
05-03-13 조회 5,767
05-03-13 조회 5,403
05-03-13 조회 4,335
05-03-13 조회 4,630
05-03-13 조회 7,893
05-03-13 조회 4,389
05-03-13 조회 3,471
05-03-13 조회 3,466
05-03-13 조회 8,012
05-03-13 조회 5,467
05-03-13 조회 4,120
05-03-12 조회 3,755
05-03-12 조회 4,469
05-02-24 조회 4,619