스크롤 이미지 한페이지에 2개넣으면 안되나요.?


자동 스크롤 이미지 인데요..
1페이지에 같은 소스를 2개 넣으니 안되서요..

어느부분을 다르게 해죠야 될까요?

==================== 이 소스를 2번 썼습니다============

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
  <TBODY>
    <TR>
      <TD> <TABLE width=550 border=0 cellPadding=0 cellSpacing=0>
          <TBODY>
            <TR>
              <TD><SCRIPT>
var dnimages = new Array;
var urls = new Array;
var buttons = new Array;


dnimages[0] = '/web/upload/01.jpg' ;
    urls[0] = '/front/php/product.php?product_no=24659&main_cate_no=25&display_group=2';
    buttons[0] = '/web/upload/r.gif';
    
    dnimages[1] = '/web/upload/02.jpg' ;
    urls[1] = '/front/php/product.php?product_no=24439&main_cate_no=7&display_group=2';
    buttons[1] = '/web/upload/r.gif';
    
    dnimages[2] = '/web/upload/03.jpg' ;
    urls[2] = '/front/php/product.php?product_no=24625&main_cate_no=7&display_group=2';
    buttons[2] = '/web/upload/r.gif';

    dnimages[3] = '/web/upload/04.jpg' ;
    urls[3] = '/front/php/product.php?product_no=24625&main_cate_no=7&display_group=2';
    buttons[3] = '/web/upload/r.gif';

    dnimages[4] = '/web/upload/05.jpg' ;
    urls[4] = '/front/php/product.php?product_no=24625&main_cate_no=7&display_group=2';
    buttons[4] = '/web/upload/r.gif';
    

var cliImg = '';
var cliImgSrc = '';
var n = Math.round(Math.random() * 7);
var interval = 2500;
var setTimeId = '';

function blursStop() {
    clearTimeout(setTimeId);
}

function blursStart() {
    blurs();
}

function chki(ci, no) {
    var pImg = document.all.RollImg;
    var pUrl = document.all.RollUrl;

    if(cliImg == '') {
        cliImg = ci;
        cliImgSrc = ci.src;
        ci.src = buttons[no];
        n=no;
        pImg.src = dnimages[no];
        pUrl.href = urls[no];        
    } else if(cliImg != ci) {
        cliImg.src = cliImgSrc;
        cliImg = ci;
        cliImgSrc = ci.src;
        ci.src = buttons[no];
        n=no;
        pImg.src = dnimages[no];
        pUrl.href = urls[no];        
    }
}

function blurs() {
    n = (n >= 4) ? 0 : n+1;
    setimgurl();
    setTimeId=setTimeout("blurs()",interval);
}

function setimgurl() {
    var ci = eval('document.all.num_img'+n);

    document.all.RollImg.filters.blendTrans.apply();
    document.all.RollUrl.href=urls[n];
    document.all.RollImg.src=dnimages[n];
    document.all.RollImg.filters.blendTrans.play();
    
    if(cliImg == '') {
        cliImg = ci;
        cliImgSrc = ci.src;
        ci.src = buttons[n];
    } else if(cliImg != ci) {
        cliImg.src = cliImgSrc;
        cliImg = ci;
        cliImgSrc = ci.src;
        ci.src = buttons[n];
    }
}

//-->
</SCRIPT>
                <TABLE cellSpacing=0 cellPadding=0 border=0 bgcolor=#FFFFFF>
                  <TBODY>
                    <TR>
                      <TD style="padding:0 0 10 0;"> <P><A onfocus=this.blur()
                  href="#" name=RollUrl><IMG
                  style="FILTER: blendTrans(duration=1)" border=0
                  name=RollImg></A></P></TD>
                      <tr><TD align=right> <TABLE cellSpacing=0 cellPadding=0 width=70 height=10 border=0  style="padding-bottom:5px;padding-left:8px;">
                          <TBODY>
                       
<TD><P><IMG style="CURSOR: hand" onclick="chki(this, 0);" src="/web/upload/b.gif" border=0 name=num_img0></P></TD>
                           
<TD><P><IMG style="CURSOR: hand" onclick="chki(this, 1);" src="/web/upload/b.gif" border=0 name=num_img1></P></TD>
                           
<TD><P><IMG style="CURSOR: hand" onclick="chki(this, 2);" src="/web/upload/b.gif" border=0 name=num_img2></P></TD>

<TD><P><IMG style="CURSOR: hand" onclick="chki(this, 3);" src="/web/upload/b.gif" border=0 name=num_img3></P></TD>

<TD><P><IMG style="CURSOR: hand" onclick="chki(this, 4);" src="/web/upload/b.gif" border=0 name=num_img3></P></TD>

                          </TBODY>
                        </TABLE></TD></tr>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE>
        <SCRIPT> blursStart(); </SCRIPT> </TD>
    </TR>
  </TBODY>
</TABLE>

|

댓글 3개

위소스를 보니 안 되겠네요.
자바스크립트 변수나 함수 이름이 겹치기 때문에 문제가 생깁니다.
해결책 없을까요? 아니면 다른 소스라도..
이 소스 자체도 애러가 있는듯한데요?
그리고 엑스엠엘님 말씀처럼 스크립트 두번 썼다고 두가지 레이어가 동작하고..그렇지 않아요 함수명이나 변수명이 겹쳐서 오류가 생기죠. 소스상의 함수들을 임의로 변경 하시거나 소스를 구해서 써야한다면 다른 소스를 붙여보세요.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
16년 전 조회 1,681
16년 전 조회 1,516
16년 전 조회 1,565
16년 전 조회 1,878
16년 전 조회 1,511
16년 전 조회 912
16년 전 조회 989
16년 전 조회 1,037
16년 전 조회 1,557
16년 전 조회 1,746
16년 전 조회 1,607
16년 전 조회 1,030
16년 전 조회 1,016
16년 전 조회 933
16년 전 조회 799
16년 전 조회 3,043
16년 전 조회 1,616
16년 전 조회 1,303
16년 전 조회 1,036
16년 전 조회 807