쇼핑몰 상품 스크롤링 > script

본문 바로가기

script

쇼핑몰 상품 스크롤링

작성일 07-08-08 19:13

페이지 정보

작성자서방님 조회 78회 댓글 0건

본문

<!---------------------------------------------------------------------------------------
▶ 기능: 스트롤 되는 추천상품, 스크롤 컨트롤 기능 추가
---------------------------------------------------------------------------------------->
<html>
<head>
<title>http://www.01code.com[ 스트롤 되는 추천상품, 스크롤 컨트롤 기능 추가 ]</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<link rel=stylesheet href="http://www.01code.com/ydhtml/01code.css" type=text/css>
<script language=javascript>
<!--
var downLayerId;
var dropDegree = 30; //스크롤 속도
var doDirect;
var DirectTerm = 4000; //스크롤 지연시간
var curDropIdx = 0;

function DirectDown()
{
    clearInterval(doDirect);
    clearInterval(downLayerId);

    for(i = curDropIdx ;i < document.all["DropHit"].length + curDropIdx;i++){
        document.all["DropHit"][i%document.all["DropHit"].length].style.posTop = document.all["DropHit"][i%document.all["DropHit"].length].style.posHeight * (-1*((i-curDropIdx)%document.all["DropHit"].length));
    }
    var temp = 'setInterval("DownLayer()",20)';
    downLayerId = eval(temp);
    direction = "down";
}
function DownLayer()
{
    if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight){
        for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
            document.all["DropHit"][j%document.all["DropHit"].length].style.posTop += dropDegree;
        }
    }else{
        clearInterval(downLayerId);
        for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
            document.all["DropHit"][j%document.all["DropHit"].length].style.posTop = document.all["DropHit"][j%document.all["DropHit"].length].style.posHeight *((-1*((j-curDropIdx)%document.all["DropHit"].length))+1);
        }
        curDropIdx = (curDropIdx + 1) ;
        curDropIdx = curDropIdx > document.all["DropHit"].length-1 ? curDropIdx%document.all["DropHit"].length:curDropIdx;
        var temp = 'setInterval("DirectDown()",DirectTerm)';
        doDirect = eval(temp);
    }
}
function DirectUp()
{
    clearInterval(doDirect);
    clearInterval(downLayerId);
    var tempIdx = 0;
    for(i = 0;i<document.all["DropHit"].length;i++){
        tempIdx = (document.all["DropHit"].length + curDropIdx - i) %document.all["DropHit"].length;
        document.all["DropHit"][tempIdx].style.posTop = i*document.all["DropHit"][tempIdx].style.posHeight;
    }
    var temp = 'setInterval("UpLayer()",20)';
    downLayerId = eval(temp);
    direction = "up";
}
function UpLayer()
{
    var tempIdx = 0;
    if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight && document.all["DropHit"][curDropIdx].style.posTop > document.all["DropHit"][curDropIdx].style.posHeight * (-1)){
        for(j = 0 ;j < document.all["DropHit"].length;j++){
            tempIdx = (document.all["DropHit"].length + curDropIdx - j) %document.all["DropHit"].length;
            document.all["DropHit"][tempIdx].style.posTop -= dropDegree;
        }
    }else{
        clearInterval(downLayerId);
        for(j = 0;j<document.all["DropHit"].length;j++){
            tempIdx = (document.all["DropHit"].length + curDropIdx - j) % document.all["DropHit"].length;
            document.all["DropHit"][tempIdx].style.posTop = (j-1)*(document.all["DropHit"][tempIdx].style.posHeight);
        }
        curDropIdx = (curDropIdx - 1) ;
        curDropIdx = curDropIdx < 0 ? document.all["DropHit"].length-1:curDropIdx;
        var temp = 'setInterval("DirectUp()",DirectTerm)';
        doDirect = eval(temp);
    }
}
//-->
</script>
</head>
<body>
<h4>[ 스트롤 되는 추천상품, 스크롤 컨트롤 기능 추가 ]</h4>

<table cellspacing=0 cellpadding=0 border=0>
<tr>
    <td>
        <div style="left:0px; overflow:hidden; width:380px; position:relative; top:0px; height:400px" width=380 >
            <div id=DropHit style="left:0px; visibility:visible; width:375px; position:absolute; top:0px; height:400px">
                <table border=0 cellpadding=0 cellspacing=0 width=375>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img01.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img02.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img03.gif width=125 ></td>
                </tr>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img04.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img05.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img06.gif width=125 ></td>
                </tr>
                </table>
            </div>
            <div id=DropHit style="left:0px; visibility:visible; width:375px; position:absolute; top:-400px; height:400px">
                <table border=0 cellpadding=0 cellspacing=0 width=375>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img04.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img05.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img06.gif width=125 ></td>
                </tr>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img04.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img05.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img06.gif width=125 ></td>
                </tr>
                </table>
            </div>
                <div id=DropHit style="left:0px; visibility:visible; width:375px; position:absolute; top:-400px; height:400px">
                <table border=0 cellpadding=0 cellspacing=0 width=375>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img04.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img05.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img06.gif width=125 ></td>
                </tr>
                <tr>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img04.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img05.gif width=125 ></td>
                    <td><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/img06.gif width=125 ></td>
                </tr>
                </table>
            </div>
            <script language=javascript>DirectDown();</script>
        </div>
    </td>
    <td>
        <table cellspacing=0 cellpadding=0 width=13 border=0>
        <tr><td><a href="javascript:DirectUp()"><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/scroll_up.gif></a></td></tr>
          <tr><td align=center><img height=173 src="http://www.01code.com/webedition/Tip_ScrollDisplay/scroll_line.gif></td></tr>
        <tr><td><a href="javascript:DirectDown()"><img border=0 src="http://www.01code.com/webedition/Tip_ScrollDisplay/scroll_down.gif></a></td></tr>
        </table>
    </td>
</tr>
</table>

</body>
</html>

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기