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

<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,774
19년 전 조회 3,592
19년 전 조회 2,118
19년 전 조회 5,538
19년 전 조회 1,881
19년 전 조회 6,228
19년 전 조회 3,043
19년 전 조회 6,215
19년 전 조회 6,991
19년 전 조회 3,893
19년 전 조회 2,373
19년 전 조회 2,252
19년 전 조회 7,051
19년 전 조회 2,545
19년 전 조회 4,100
19년 전 조회 5,500
19년 전 조회 2,827
19년 전 조회 1,874
19년 전 조회 1,722
19년 전 조회 1,675
19년 전 조회 1,947
19년 전 조회 1,958
19년 전 조회 1,948
19년 전 조회 1,865
19년 전 조회 2,667
19년 전 조회 2,480
19년 전 조회 3,622
19년 전 조회 2,753
19년 전 조회 2,722
19년 전 조회 3,568
19년 전 조회 4,778
19년 전 조회 3,126
19년 전 조회 2,965
19년 전 조회 3,508
19년 전 조회 6,440
19년 전 조회 2,354
19년 전 조회 2,154
19년 전 조회 2,115
19년 전 조회 2,168
19년 전 조회 3,340
19년 전 조회 2,416
19년 전 조회 2,094
19년 전 조회 1,802
19년 전 조회 2,250
19년 전 조회 3,522
19년 전 조회 3,369
19년 전 조회 2,082
19년 전 조회 1,645
19년 전 조회 3,327
19년 전 조회 2,212
19년 전 조회 1,774
19년 전 조회 2,995
19년 전 조회 2,131
19년 전 조회 1,998
19년 전 조회 1,977
19년 전 조회 1,929
19년 전 조회 2,367
19년 전 조회 2,783
19년 전 조회 1,935
19년 전 조회 1,684
19년 전 조회 1,686
19년 전 조회 1,647
19년 전 조회 3,368
19년 전 조회 3,069
19년 전 조회 1,806
19년 전 조회 3,573
19년 전 조회 1,991
19년 전 조회 1,637
19년 전 조회 2,102
19년 전 조회 2,256
19년 전 조회 1,812
19년 전 조회 2,498
19년 전 조회 2,136
19년 전 조회 1,752
19년 전 조회 1,943
19년 전 조회 2,199
19년 전 조회 1,963
19년 전 조회 1,749
19년 전 조회 1,805
19년 전 조회 3,304
19년 전 조회 2,158
19년 전 조회 2,020
19년 전 조회 4,519
19년 전 조회 5,141
19년 전 조회 3,317
19년 전 조회 3,053
19년 전 조회 3,653
19년 전 조회 2,188
19년 전 조회 2,545
19년 전 조회 2,846
19년 전 조회 2,914
19년 전 조회 2,516
19년 전 조회 1,782
19년 전 조회 3,565
19년 전 조회 2,136
19년 전 조회 2,540
19년 전 조회 2,598
19년 전 조회 3,048
19년 전 조회 5,363
19년 전 조회 2,641