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

<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,829
19년 전 조회 3,644
19년 전 조회 2,171
19년 전 조회 5,587
19년 전 조회 1,936
19년 전 조회 6,283
19년 전 조회 3,094
19년 전 조회 6,266
19년 전 조회 7,042
19년 전 조회 3,948
19년 전 조회 2,425
19년 전 조회 2,312
19년 전 조회 7,100
19년 전 조회 2,605
19년 전 조회 4,161
19년 전 조회 5,547
19년 전 조회 2,887
19년 전 조회 1,924
19년 전 조회 1,775
19년 전 조회 1,725
19년 전 조회 2,005
19년 전 조회 2,014
19년 전 조회 1,999
19년 전 조회 1,922
19년 전 조회 2,717
19년 전 조회 2,535
19년 전 조회 3,675
19년 전 조회 2,802
19년 전 조회 2,774
19년 전 조회 3,614
19년 전 조회 4,828
19년 전 조회 3,174
19년 전 조회 3,018
19년 전 조회 3,567
19년 전 조회 6,489
19년 전 조회 2,406
19년 전 조회 2,210
19년 전 조회 2,163
19년 전 조회 2,219
19년 전 조회 3,394
19년 전 조회 2,463
19년 전 조회 2,145
19년 전 조회 1,845
19년 전 조회 2,300
19년 전 조회 3,574
19년 전 조회 3,433
19년 전 조회 2,132
19년 전 조회 1,693
19년 전 조회 3,385
19년 전 조회 2,256
19년 전 조회 1,831
19년 전 조회 3,045
19년 전 조회 2,175
19년 전 조회 2,056
19년 전 조회 2,027
19년 전 조회 1,988
19년 전 조회 2,412
19년 전 조회 2,836
19년 전 조회 1,988
19년 전 조회 1,731
19년 전 조회 1,737
19년 전 조회 1,693
19년 전 조회 3,425
19년 전 조회 3,118
19년 전 조회 1,861
19년 전 조회 3,618
19년 전 조회 2,043
19년 전 조회 1,685
19년 전 조회 2,156
19년 전 조회 2,303
19년 전 조회 1,863
19년 전 조회 2,548
19년 전 조회 2,190
19년 전 조회 1,800
19년 전 조회 1,992
19년 전 조회 2,253
19년 전 조회 2,012
19년 전 조회 1,801
19년 전 조회 1,866
19년 전 조회 3,358
19년 전 조회 2,213
19년 전 조회 2,073
19년 전 조회 4,565
19년 전 조회 5,191
19년 전 조회 3,360
19년 전 조회 3,098
19년 전 조회 3,700
19년 전 조회 2,242
19년 전 조회 2,600
19년 전 조회 2,896
19년 전 조회 2,967
19년 전 조회 2,561
19년 전 조회 1,831
19년 전 조회 3,619
19년 전 조회 2,186
19년 전 조회 2,593
19년 전 조회 2,658
19년 전 조회 3,086
19년 전 조회 5,415
19년 전 조회 2,696