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

<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,706
19년 전 조회 3,517
19년 전 조회 2,047
19년 전 조회 5,466
19년 전 조회 1,800
19년 전 조회 6,164
19년 전 조회 2,974
19년 전 조회 6,147
19년 전 조회 6,921
19년 전 조회 3,822
19년 전 조회 2,296
19년 전 조회 2,198
19년 전 조회 6,981
19년 전 조회 2,473
19년 전 조회 4,038
19년 전 조회 5,435
19년 전 조회 2,765
19년 전 조회 1,809
19년 전 조회 1,652
19년 전 조회 1,602
19년 전 조회 1,885
19년 전 조회 1,893
19년 전 조회 1,886
19년 전 조회 1,797
19년 전 조회 2,594
19년 전 조회 2,402
19년 전 조회 3,552
19년 전 조회 2,683
19년 전 조회 2,651
19년 전 조회 3,492
19년 전 조회 4,720
19년 전 조회 3,067
19년 전 조회 2,894
19년 전 조회 3,433
19년 전 조회 6,376
19년 전 조회 2,290
19년 전 조회 2,089
19년 전 조회 2,051
19년 전 조회 2,100
19년 전 조회 3,282
19년 전 조회 2,350
19년 전 조회 2,029
19년 전 조회 1,729
19년 전 조회 2,184
19년 전 조회 3,460
19년 전 조회 3,307
19년 전 조회 2,009
19년 전 조회 1,582
19년 전 조회 3,264
19년 전 조회 2,145
19년 전 조회 1,705
19년 전 조회 2,936
19년 전 조회 2,068
19년 전 조회 1,951
19년 전 조회 1,909
19년 전 조회 1,871
19년 전 조회 2,306
19년 전 조회 2,724
19년 전 조회 1,871
19년 전 조회 1,622
19년 전 조회 1,623
19년 전 조회 1,578
19년 전 조회 3,300
19년 전 조회 3,007
19년 전 조회 1,744
19년 전 조회 3,504
19년 전 조회 1,935
19년 전 조회 1,574
19년 전 조회 2,048
19년 전 조회 2,185
19년 전 조회 1,738
19년 전 조회 2,427
19년 전 조회 2,081
19년 전 조회 1,697
19년 전 조회 1,874
19년 전 조회 2,129
19년 전 조회 1,903
19년 전 조회 1,674
19년 전 조회 1,739
19년 전 조회 3,244
19년 전 조회 2,089
19년 전 조회 1,952
19년 전 조회 4,459
19년 전 조회 5,085
19년 전 조회 3,243
19년 전 조회 2,981
19년 전 조회 3,583
19년 전 조회 2,129
19년 전 조회 2,492
19년 전 조회 2,775
19년 전 조회 2,851
19년 전 조회 2,454
19년 전 조회 1,713
19년 전 조회 3,486
19년 전 조회 2,062
19년 전 조회 2,470
19년 전 조회 2,537
19년 전 조회 2,976
19년 전 조회 5,306
19년 전 조회 2,567