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

<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,639
19년 전 조회 3,452
19년 전 조회 1,969
19년 전 조회 5,394
19년 전 조회 1,719
19년 전 조회 6,070
19년 전 조회 2,890
19년 전 조회 6,054
19년 전 조회 6,854
19년 전 조회 3,744
19년 전 조회 2,225
19년 전 조회 2,115
19년 전 조회 6,914
19년 전 조회 2,411
19년 전 조회 3,967
19년 전 조회 5,351
19년 전 조회 2,695
19년 전 조회 1,753
19년 전 조회 1,593
19년 전 조회 1,534
19년 전 조회 1,810
19년 전 조회 1,804
19년 전 조회 1,802
19년 전 조회 1,733
19년 전 조회 2,531
19년 전 조회 2,327
19년 전 조회 3,487
19년 전 조회 2,614
19년 전 조회 2,587
19년 전 조회 3,435
19년 전 조회 4,649
19년 전 조회 2,987
19년 전 조회 2,819
19년 전 조회 3,368
19년 전 조회 6,304
19년 전 조회 2,204
19년 전 조회 2,008
19년 전 조회 1,962
19년 전 조회 2,019
19년 전 조회 3,210
19년 전 조회 2,278
19년 전 조회 1,966
19년 전 조회 1,651
19년 전 조회 2,094
19년 전 조회 3,378
19년 전 조회 3,247
19년 전 조회 1,922
19년 전 조회 1,499
19년 전 조회 3,196
19년 전 조회 2,067
19년 전 조회 1,635
19년 전 조회 2,853
19년 전 조회 1,988
19년 전 조회 1,862
19년 전 조회 1,833
19년 전 조회 1,795
19년 전 조회 2,219
19년 전 조회 2,641
19년 전 조회 1,802
19년 전 조회 1,538
19년 전 조회 1,546
19년 전 조회 1,478
19년 전 조회 3,238
19년 전 조회 2,932
19년 전 조회 1,688
19년 전 조회 3,423
19년 전 조회 1,847
19년 전 조회 1,503
19년 전 조회 1,964
19년 전 조회 2,108
19년 전 조회 1,645
19년 전 조회 2,349
19년 전 조회 2,002
19년 전 조회 1,612
19년 전 조회 1,795
19년 전 조회 2,049
19년 전 조회 1,796
19년 전 조회 1,604
19년 전 조회 1,668
19년 전 조회 3,133
19년 전 조회 2,006
19년 전 조회 1,877
19년 전 조회 4,378
19년 전 조회 5,007
19년 전 조회 3,170
19년 전 조회 2,903
19년 전 조회 3,506
19년 전 조회 2,051
19년 전 조회 2,397
19년 전 조회 2,694
19년 전 조회 2,776
19년 전 조회 2,362
19년 전 조회 1,624
19년 전 조회 3,388
19년 전 조회 1,986
19년 전 조회 2,401
19년 전 조회 2,463
19년 전 조회 2,884
19년 전 조회 5,213
19년 전 조회 2,493