일정시간동안 이미지 자동으로 변경하기

<script language="JavaScript" type="text/javascript">
<!--
// 이미지 경로
var imgLeft = new Array() ;
var imgRight = new Array() ;
imgLeft[0] = new Image() ;
imgLeft[0].src = "./img/ex_a1.gif" ;
imgLeft[1] = new Image() ;
imgLeft[1].src = "./img/ex_a2.gif" ;
imgLeft[2] = new Image() ;
imgLeft[2].src = "./img/ex_a3.gif" ;
imgRight[0] = new Image() ;
imgRight[0].src = "./img/ex_b1.gif" ;
imgRight[1] = new Image() ;
imgRight[1].src = "./img/ex_b2.gif" ;
imgRight[2] = new Image() ;
imgRight[2].src = "./img/ex_b3.gif" ;

// 이미지 링크
var urlLeft = new Array() ;
var urlRight = new Array() ;
urlLeft[0] = "#" ;
urlLeft[1] = "#" ;
urlLeft[2] = "#" ;
urlRight[0] = "1" ;
urlRight[1] = "2" ;
urlRight[2] = "3" ;

var productAll = "" ;
productAll += "<table width='400' cellpadding='0' cellspacing='0' border='1'>" ;
productAll += "<tr><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlLeft[0] + "'><img src='" + imgLeft[0].src + "' border='0'></a>" ;
productAll += "</td><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlRight[0] + "'><img src='" + imgRight[0].src + "' border='0'></a>" ;
productAll += "</td></tr>" ;
productAll += "<tr><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlLeft[1] + "'><img src='" + imgLeft[1].src + "' border='0'></a>" ;
productAll += "</td><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlRight[1] + "'><img src='" + imgRight[1].src + "' border='0'></a>" ;
productAll += "</td></tr>" ;
productAll += "<tr><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlLeft[2] + "'><img src='" + imgLeft[2].src + "' border='0'></a>" ;
productAll += "</td><td width='200' height='150' align='center'>" ;
productAll += "<a href='" + urlRight[2] + "'><img src='" + imgRight[2].src + "' border='0'></a>" ;
productAll += "</td></tr></table>" ;

var time = 1500 ;
var counter = 1 ;

function imgShowInit() {
productContent = "<div style='left:0px ; width:100% ; position:absolute ; top:0px ; height:450px ;' id='showProduct'>" ;
productContent += productAll ;
productContent += "</div>" ;

document.write(productContent) ;
window.setTimeout("imgShow()", time) ;
}

function imgShow() {
if(counter == 3)
counter = 0 ;

tmp = document.getElementById("showProduct").style ;
tmp.top = -150 * counter ;
counter++ ;

window.setTimeout("imgShow()", time) ;
}
// -->
</script>





<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<div style="theight:150px ; width:400px ; position:absolute; overflow:hidden; visibility: visible ; border:1px solid #000000 ;" id="productPos">
<script>imgShowInit();</script>
</div>
</td>
</tr>
</table><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
19년 전 조회 2,648
19년 전 조회 3,466
19년 전 조회 1,977
19년 전 조회 5,409
19년 전 조회 1,735
19년 전 조회 6,087
19년 전 조회 2,903
19년 전 조회 6,072
19년 전 조회 6,868
19년 전 조회 3,761
19년 전 조회 2,239
19년 전 조회 2,130
19년 전 조회 6,929
19년 전 조회 2,426
19년 전 조회 3,983
19년 전 조회 5,367
19년 전 조회 2,708
19년 전 조회 1,765
19년 전 조회 1,605
19년 전 조회 1,547
19년 전 조회 1,822
19년 전 조회 1,825
19년 전 조회 1,830
19년 전 조회 1,749
19년 전 조회 2,541
19년 전 조회 2,343
19년 전 조회 3,504
19년 전 조회 2,633
19년 전 조회 2,604
19년 전 조회 3,444
19년 전 조회 4,662
19년 전 조회 3,007
19년 전 조회 2,834
19년 전 조회 3,383
19년 전 조회 6,324
19년 전 조회 2,221
19년 전 조회 2,024
19년 전 조회 1,979
19년 전 조회 2,035
19년 전 조회 3,223
19년 전 조회 2,296
19년 전 조회 1,985
19년 전 조회 1,664
19년 전 조회 2,120
19년 전 조회 3,401
19년 전 조회 3,257
19년 전 조회 1,944
19년 전 조회 1,520
19년 전 조회 3,212
19년 전 조회 2,083
19년 전 조회 1,649
19년 전 조회 2,867
19년 전 조회 2,003
19년 전 조회 1,883
19년 전 조회 1,846
19년 전 조회 1,808
19년 전 조회 2,237
19년 전 조회 2,655
19년 전 조회 1,817
19년 전 조회 1,549
19년 전 조회 1,563
19년 전 조회 1,497
19년 전 조회 3,252
19년 전 조회 2,943
19년 전 조회 1,699
19년 전 조회 3,438
19년 전 조회 1,859
19년 전 조회 1,513
19년 전 조회 1,978
19년 전 조회 2,118
19년 전 조회 1,670
19년 전 조회 2,366
19년 전 조회 2,014
19년 전 조회 1,629
19년 전 조회 1,806
19년 전 조회 2,069
19년 전 조회 1,819
19년 전 조회 1,614
19년 전 조회 1,677
19년 전 조회 3,154
19년 전 조회 2,023
19년 전 조회 1,887
19년 전 조회 4,386
19년 전 조회 5,015
19년 전 조회 3,182
19년 전 조회 2,915
19년 전 조회 3,521
19년 전 조회 2,060
19년 전 조회 2,418
19년 전 조회 2,708
19년 전 조회 2,785
19년 전 조회 2,381
19년 전 조회 1,642
19년 전 조회 3,405
19년 전 조회 2,000
19년 전 조회 2,407
19년 전 조회 2,470
19년 전 조회 2,902
19년 전 조회 5,230
19년 전 조회 2,504