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

· 10년 전 · 324

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

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

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
10년 전 조회 392
10년 전 조회 366
10년 전 조회 364
10년 전 조회 1,023
10년 전 조회 407
10년 전 조회 398
10년 전 조회 387
10년 전 조회 518
10년 전 조회 976
10년 전 조회 551
10년 전 조회 397
10년 전 조회 362
10년 전 조회 376
10년 전 조회 439
10년 전 조회 360
10년 전 조회 419
10년 전 조회 341
10년 전 조회 485
10년 전 조회 378
10년 전 조회 381
10년 전 조회 321
10년 전 조회 921
10년 전 조회 415
10년 전 조회 371
10년 전 조회 387
10년 전 조회 368
10년 전 조회 400
10년 전 조회 382
10년 전 조회 873
10년 전 조회 325
10년 전 조회 373
10년 전 조회 266
10년 전 조회 877
10년 전 조회 418
10년 전 조회 394
10년 전 조회 466
10년 전 조회 437
10년 전 조회 490
10년 전 조회 367
10년 전 조회 266
10년 전 조회 372
10년 전 조회 300
10년 전 조회 638
10년 전 조회 314
10년 전 조회 283
10년 전 조회 336
10년 전 조회 340
10년 전 조회 387
10년 전 조회 305
10년 전 조회 325
10년 전 조회 491
10년 전 조회 334
10년 전 조회 385
10년 전 조회 371
10년 전 조회 393
10년 전 조회 503
10년 전 조회 375
10년 전 조회 334
10년 전 조회 358
10년 전 조회 462
10년 전 조회 374
10년 전 조회 320
10년 전 조회 335
10년 전 조회 334
10년 전 조회 297
10년 전 조회 298
10년 전 조회 508
10년 전 조회 728
10년 전 조회 535
10년 전 조회 342
10년 전 조회 337
10년 전 조회 300
10년 전 조회 312
10년 전 조회 423
10년 전 조회 343
10년 전 조회 271
10년 전 조회 315
10년 전 조회 700
10년 전 조회 1,167
10년 전 조회 727
10년 전 조회 524
10년 전 조회 503
10년 전 조회 386
10년 전 조회 361
10년 전 조회 370
10년 전 조회 337
10년 전 조회 362
10년 전 조회 381
10년 전 조회 513
10년 전 조회 420
10년 전 조회 1,148
10년 전 조회 703
10년 전 조회 433
10년 전 조회 501
10년 전 조회 770
10년 전 조회 481
10년 전 조회 609
10년 전 조회 447
10년 전 조회 563
10년 전 조회 394
🐛 버그신고