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

<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,626
19년 전 조회 3,441
19년 전 조회 1,957
19년 전 조회 5,386
19년 전 조회 1,706
19년 전 조회 6,059
19년 전 조회 2,880
19년 전 조회 6,046
19년 전 조회 6,842
19년 전 조회 3,734
19년 전 조회 2,216
19년 전 조회 2,106
19년 전 조회 6,906
19년 전 조회 2,406
19년 전 조회 3,957
19년 전 조회 5,344
19년 전 조회 2,690
19년 전 조회 1,745
19년 전 조회 1,583
19년 전 조회 1,525
19년 전 조회 1,800
19년 전 조회 1,798
19년 전 조회 1,790
19년 전 조회 1,724
19년 전 조회 2,518
19년 전 조회 2,318
19년 전 조회 3,474
19년 전 조회 2,605
19년 전 조회 2,578
19년 전 조회 3,426
19년 전 조회 4,639
19년 전 조회 2,974
19년 전 조회 2,809
19년 전 조회 3,361
19년 전 조회 6,289
19년 전 조회 2,194
19년 전 조회 1,999
19년 전 조회 1,950
19년 전 조회 2,011
19년 전 조회 3,196
19년 전 조회 2,268
19년 전 조회 1,959
19년 전 조회 1,638
19년 전 조회 2,084
19년 전 조회 3,368
19년 전 조회 3,237
19년 전 조회 1,914
19년 전 조회 1,492
19년 전 조회 3,189
19년 전 조회 2,062
19년 전 조회 1,625
19년 전 조회 2,843
19년 전 조회 1,976
19년 전 조회 1,849
19년 전 조회 1,822
19년 전 조회 1,789
19년 전 조회 2,211
19년 전 조회 2,634
19년 전 조회 1,792
19년 전 조회 1,530
19년 전 조회 1,538
19년 전 조회 1,469
19년 전 조회 3,232
19년 전 조회 2,922
19년 전 조회 1,678
19년 전 조회 3,416
19년 전 조회 1,841
19년 전 조회 1,490
19년 전 조회 1,954
19년 전 조회 2,099
19년 전 조회 1,635
19년 전 조회 2,339
19년 전 조회 1,997
19년 전 조회 1,605
19년 전 조회 1,785
19년 전 조회 2,041
19년 전 조회 1,790
19년 전 조회 1,594
19년 전 조회 1,659
19년 전 조회 3,127
19년 전 조회 1,996
19년 전 조회 1,868
19년 전 조회 4,369
19년 전 조회 4,997
19년 전 조회 3,158
19년 전 조회 2,891
19년 전 조회 3,497
19년 전 조회 2,042
19년 전 조회 2,392
19년 전 조회 2,687
19년 전 조회 2,763
19년 전 조회 2,350
19년 전 조회 1,612
19년 전 조회 3,381
19년 전 조회 1,978
19년 전 조회 2,390
19년 전 조회 2,451
19년 전 조회 2,874
19년 전 조회 5,205
19년 전 조회 2,486