2011년 11월 30일 수요일

세로 슬라이드 메뉴 간격조절 오류

 <!-- .text 부분의 간격조절이 안된다.-->

<style type="text/css">
.link {position:absolute;width:100%;height:0;visibility:hidden;overflow:hidden;background:cyan}

.title{position:relative;width:100%;font:bold 11pt verdana;color:white;cursor:pointer;background:orange}

.title_o {position:relative;cursor:pointer;width:100%;height:40px;font:bold 11pt verdana;overflow:hidden;color:white;background:blue}

.text {position:relative;margin:0;padding:0;font-family:verdana;font-size:10pt;overflow:hidden}
.text a{padding:10px 0}

</style>
<script type="text/javascript">
<!--
var object = new Array();

function Slide(N,oCont){
   this.N  = N;
   this.S  = 1.1;
   this.object = new Array();

   this.CObj = function (parent,N){

   this.parent = parent;
   this.N = N;
   this.obj = parent.frm[N];
   this.tit = this.obj.firstChild;
   this.div = this.obj.getElementsByTagName("div")[1];
   this.div.style.visibility = "hidden";
   this.y0 = N * 18;
   this.Y1 = this.y0;
   this.obj.style.top = this.y0;
   this.obj.style.height = parent.H - (parent.NF-1) * 18 - 1;
   this.obj.style.visibility = "visible";
   this.obj.parent = this;
   this.run = false;

   this.move = function(){
        with(this){
            dy = (y1-y0)/parent.S;
            if(Math.abs(dy)>.1){
      y0+=dy;
      obj.style.top = Math.round(y0);
      setTimeout("object["+parent.N+"].object["+N+"].move();", 16);
             } else {
      run = false;
      if(dy>0)div.style.visibility="hidden";
      else if(N>0)parent.object[N-1].div.style.visibility="hidden";
      }
             }
     }

   this.obj.onmouseover = function(){
           with(this.parent){
               if(!run){
      run = true;
      div.style.visibility="visible";
      for(i=0;i<parent.NF;i++)parent.object[i].tit.className = "title";
         tit.className = "title_o";
         for(i=0;i<=N;i++){
              parent.object[i].y1 = i*18;
              parent.object[i].move();
         }
      for(i=N+1;i<parent.NF;i++){
              parent.object[i].y1 = parent.H-(parent.NF-i)*18;
              parent.object[i].move();
      }
                 }
             }
                    }
   }

   this.frm = document.getElementById(oCont);
   this.H = parseInt(this.frm.style.height);
   this.frm = this.frm.getElementsByTagName("span");
   this.NF = this.frm.length;
   for(i=0;i<this.NF;i++) this.object[i] = new this.CObj(this, i);
   this.object[0].obj.onmouseover();
   this.S = 10;
}

onload = function() {
   object[0] = new Slide(0, "frames");
}

//-->
</script>
</head>

<body>
<div id="frames" style="position:absolute;width:200;height:200;overflow:hidden">
        <span class="link"><div class="title">메뉴 1</div>
              <div class="text">
                 <a href="http://kiche.tk/bbs/board.php?bo_table=intro">글타래</a><br />


               </div>
          </span>
         
          <span class="link"><div class="title">메뉴 2</div>
            <div class="text">
               서브메뉴 - 1<br>
               서브메뉴 - 2<br>
            </div>
         </span>
        
         <span class="link"><div class="title">메뉴 3</div>
           <div class="text">
              서브메뉴 - 1<br>
              서브메뉴 - 2<br>
            </div>
         </span>
        
         <span class="link"><div class="title">메뉴 4</div>
             <div class="text">
                서브메뉴 - 1<br>
                서브메뉴 - 2<br>
           </div>
          </span>
          <span class="link"><div class="title">메뉴 5</div>
              <div class="text">
                 서브메뉴 - 1<br>
                 서브메뉴 - 2<br>
              </div>
        </span>
   </div>

댓글 없음:

댓글 쓰기