사이트 내 전체검색
아래위로 텍스트, 이미지 스크롤 제어되는 자바스크립트
로빈아빠
https://cmd.kr/javascript/636 URL이 복사되었습니다.

본문

아래위로 텍스트, 이미지 스크롤 제어되는 자바스크립트

<DIV style="LEFT: 0px; OVERFLOW: hidden; WIDTH: 234px; POSITION: relative; TOP: 5px; HEIGHT: 90px" width="206" height="104"> 
  <DIV id=RollingBanner style="LEFT: 0px; VISIBILITY: visible; WIDTH: 234px; POSITION: absolute; TOP: 0px; HEIGHT: 90px"> 
    <table width="234" height="80" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="80"><a href="search/cd.html?cd_no=7682"><img src="http://www.shop-wiz.com/img/maintitle1.gif" width="80" height="80" border="0"></a></td>
        <td width="15">&nbsp;</td>
        <td><a href="test.php"> <font color=#000000>test</font><br>
          test<br>
          Price : </font> <font color="#E17100"><b>100,000 원</b></font> </a> </td>
      </tr>
    </table>
  </DIV>
  <DIV id=RollingBanner style="LEFT: 0px; VISIBILITY: visible; WIDTH: 234px; POSITION: absolute; TOP: 0px; HEIGHT: 90px"> 
    <table width="234" height="80" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="80"><a href="search/cd.html?cd_no=7707"><img src="http://www.shop-wiz.com/img/maintitle2.gif" width="80" height="80" border="0"></a></td>
        <td width="15">&nbsp;</td>
        <td><a href="test.php"> <font color=#000000>test</font><br>
          testtest<br>
          Price : </font> <font color="#E17100"><b>699,000 원</b></font> </a> </td>
      </tr>
    </table>
  </DIV>
</DIV>
<a href="javascript:RollingUp();">위로</a> <a href="javascript:RollingDown();">아래로</a> 
<script language="JavaScript">
<!--
var downLayerId;
var dropDegree = 10;
var doDirect;
var DirectTerm = 4500;
var curDropIdx = 0;

function RollingDown(){
    clearInterval(doDirect);
    clearInterval(downLayerId);
    
    for(i = curDropIdx ;i < document.all["RollingBanner"].length + curDropIdx;i++){
        document.all["RollingBanner"][i%document.all["RollingBanner"].length].style.posTop = document.all["RollingBanner"][i%document.all["RollingBanner"].length].style.posHeight * (-1*((i-curDropIdx)%document.all["RollingBanner"].length));
    }  
    
    var temp = 'setInterval("DownLayer()",20)';                            
    downLayerId = eval(temp);
    direction = "down";
}

function DownLayer(){
    if(document.all["RollingBanner"][curDropIdx].style.posTop < document.all["RollingBanner"][curDropIdx].style.posHeight)
    {
        for(j = curDropIdx ;j < document.all["RollingBanner"].length + curDropIdx;j++){
            document.all["RollingBanner"][j%document.all["RollingBanner"].length].style.posTop += dropDegree;
        }
    }
    else{
        clearInterval(downLayerId);
        
        for(j = curDropIdx ;j < document.all["RollingBanner"].length + curDropIdx;j++){
            document.all["RollingBanner"][j%document.all["RollingBanner"].length].style.posTop = document.all["RollingBanner"][j%document.all["RollingBanner"].length].style.posHeight *((-1*((j-curDropIdx)%document.all["RollingBanner"].length))+1);
        }
        curDropIdx = (curDropIdx + 1) ;
        curDropIdx = curDropIdx > document.all["RollingBanner"].length-1 ? curDropIdx%document.all["RollingBanner"].length:curDropIdx;
        var temp = 'setInterval("RollingDown()",DirectTerm)';
        doDirect = eval(temp);
    }
}

function RollingUp(){
    clearInterval(doDirect);
    clearInterval(downLayerId);
    var tempIdx = 0;
    for(i = 0;i<document.all["RollingBanner"].length;i++){
        tempIdx = (document.all["RollingBanner"].length + curDropIdx - i) %document.all["RollingBanner"].length;
    
        document.all["RollingBanner"][tempIdx].style.posTop = i*document.all["RollingBanner"][tempIdx].style.posHeight;
    
    }  
    
    var temp = 'setInterval("UpLayer()",20)';                            
    downLayerId = eval(temp);
    direction = "up";
}

function UpLayer(){
    var tempIdx = 0;
    if(document.all["RollingBanner"][curDropIdx].style.posTop < document.all["RollingBanner"][curDropIdx].style.posHeight && document.all["RollingBanner"][curDropIdx].style.posTop > document.all["RollingBanner"][curDropIdx].style.posHeight * (-1))
    {
        for(j = 0 ;j < document.all["RollingBanner"].length;j++){
            tempIdx = (document.all["RollingBanner"].length + curDropIdx - j) %document.all["RollingBanner"].length;
            document.all["RollingBanner"][tempIdx].style.posTop -= dropDegree;
        }
    }
    else{
        clearInterval(downLayerId);
		for(j = 0;j<document.all["RollingBanner"].length;j++){
            tempIdx = (document.all["RollingBanner"].length + curDropIdx - j) % document.all["RollingBanner"].length;
            
            document.all["RollingBanner"][tempIdx].style.posTop = (j-1)*(document.all["RollingBanner"][tempIdx].style.posHeight);  
        }
        curDropIdx = (curDropIdx - 1) ;
        curDropIdx = curDropIdx < 0 ? document.all["RollingBanner"].length-1:curDropIdx;
        var temp = 'setInterval("RollingUp()",DirectTerm)';
        doDirect = eval(temp);
    }
}

RollingUp()
//-->
</script>
>

댓글목록

등록된 댓글이 없습니다.

831 (4/17P)

Search

Copyright © Cmd 명령어 18.219.207.11