천

가운데 정렬된 홈페이지에서 따라다니는 레이어 자바스크립트 입니다.

· 2015-12-20 (일) 00:07:49 · 2617

<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>

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-06-11 조회 3,046
16-02-15 조회 3,286
16-02-02 조회 2,949
16-01-25 조회 2,572
16-01-18 조회 2,656
16-01-08 조회 2,597
16-01-07 조회 2,606
16-01-05 조회 2,645
16-01-05 조회 2,938
16-01-05 조회 2,765
16-01-05 조회 2,792
16-01-04 조회 2,652
16-01-04 조회 2,657
16-01-04 조회 2,610
16-01-04 조회 2,521
15-12-30 조회 2,878
15-12-24 조회 2,692
15-12-24 조회 2,684
15-12-24 조회 2,711
15-12-24 조회 2,668
15-12-23 조회 2,656
15-12-16 조회 2,743
15-12-15 조회 2,811
15-12-11 조회 2,937
15-12-10 조회 2,795
15-11-09 조회 2,784
15-11-09 조회 3,005
15-10-06 조회 3,337
15-10-02 조회 3,115
15-05-29 조회 4,448
15-02-02 조회 4,426
15-01-18 조회 4,401
14-10-25 조회 8,371
14-10-25 조회 5,143
14-10-22 조회 7,147
14-10-22 조회 4,852
14-10-22 조회 4,806
14-10-18 조회 5,679
14-10-17 조회 6,052
14-10-17 조회 5,429
14-10-17 조회 8,913
14-10-17 조회 6,441
14-10-13 조회 4,358
14-10-13 조회 4,463
14-10-07 조회 6,143
14-09-24 조회 3,913
14-09-23 조회 3,981
14-09-22 조회 4,880
14-09-22 조회 6,109
14-09-22 조회 4,081
14-09-22 조회 3,755
14-09-21 조회 4,360
14-09-21 조회 3,841
14-09-20 조회 3,844
14-09-20 조회 3,755
14-09-20 조회 3,930
14-09-19 조회 3,861
14-09-19 조회 4,016
14-09-19 조회 3,908
14-09-19 조회 4,299
14-09-19 조회 3,926
14-09-19 조회 3,857
14-09-19 조회 4,137
14-09-19 조회 3,882
14-09-19 조회 3,928
14-09-19 조회 3,912
14-09-18 조회 3,989
14-09-18 조회 3,948
14-09-18 조회 4,220
14-09-18 조회 4,181
14-09-18 조회 4,193
14-09-18 조회 4,893
14-09-18 조회 5,448
14-09-18 조회 5,333
14-09-18 조회 4,127
14-09-18 조회 4,622
14-09-18 조회 4,252
14-08-30 조회 5,481
14-08-06 조회 6,002
14-08-06 조회 5,616
14-08-03 조회 5,266
14-06-12 조회 5,538
14-05-11 조회 3,714
14-05-11 조회 4,477
14-05-11 조회 4,584
14-05-09 조회 1.3만
14-05-01 조회 5,169
14-03-30 조회 4,387
14-03-23 조회 8,008
14-02-12 조회 3,884
13-10-29 조회 7,850
13-10-28 조회 8,678
13-09-29 조회 6,642
13-09-29 조회 4,268
13-07-23 조회 5,137
13-07-23 조회 1.2만
13-07-14 조회 4,681
13-07-14 조회 5,062
13-07-14 조회 6,016
13-07-14 조회 5,303