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

<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,623
19년 전 조회 3,437
19년 전 조회 1,950
19년 전 조회 5,383
19년 전 조회 1,701
19년 전 조회 6,056
19년 전 조회 2,879
19년 전 조회 6,043
19년 전 조회 6,838
19년 전 조회 3,730
19년 전 조회 2,213
19년 전 조회 2,104
19년 전 조회 6,902
19년 전 조회 2,400
19년 전 조회 3,954
19년 전 조회 5,343
19년 전 조회 2,686
19년 전 조회 1,744
19년 전 조회 1,579
19년 전 조회 1,523
19년 전 조회 1,797
19년 전 조회 1,794
19년 전 조회 1,787
19년 전 조회 1,721
19년 전 조회 2,514
19년 전 조회 2,314
19년 전 조회 3,473
19년 전 조회 2,601
19년 전 조회 2,575
19년 전 조회 3,421
19년 전 조회 4,635
19년 전 조회 2,969
19년 전 조회 2,807
19년 전 조회 3,356
19년 전 조회 6,287
19년 전 조회 2,192
19년 전 조회 1,997
19년 전 조회 1,946
19년 전 조회 2,007
19년 전 조회 3,193
19년 전 조회 2,268
19년 전 조회 1,955
19년 전 조회 1,635
19년 전 조회 2,083
19년 전 조회 3,368
19년 전 조회 3,237
19년 전 조회 1,911
19년 전 조회 1,487
19년 전 조회 3,185
19년 전 조회 2,057
19년 전 조회 1,624
19년 전 조회 2,841
19년 전 조회 1,975
19년 전 조회 1,846
19년 전 조회 1,821
19년 전 조회 1,787
19년 전 조회 2,208
19년 전 조회 2,632
19년 전 조회 1,790
19년 전 조회 1,528
19년 전 조회 1,536
19년 전 조회 1,465
19년 전 조회 3,229
19년 전 조회 2,921
19년 전 조회 1,675
19년 전 조회 3,410
19년 전 조회 1,836
19년 전 조회 1,487
19년 전 조회 1,954
19년 전 조회 2,096
19년 전 조회 1,630
19년 전 조회 2,338
19년 전 조회 1,992
19년 전 조회 1,602
19년 전 조회 1,783
19년 전 조회 2,037
19년 전 조회 1,786
19년 전 조회 1,591
19년 전 조회 1,655
19년 전 조회 3,125
19년 전 조회 1,993
19년 전 조회 1,864
19년 전 조회 4,366
19년 전 조회 4,995
19년 전 조회 3,157
19년 전 조회 2,889
19년 전 조회 3,493
19년 전 조회 2,038
19년 전 조회 2,388
19년 전 조회 2,685
19년 전 조회 2,759
19년 전 조회 2,347
19년 전 조회 1,609
19년 전 조회 3,376
19년 전 조회 1,974
19년 전 조회 2,387
19년 전 조회 2,448
19년 전 조회 2,872
19년 전 조회 5,201
19년 전 조회 2,482
🐛 버그신고