2012. 9. 12. 11:36

이미지 슬라이드

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<html>

<head>

<title>이미지 슬라이드</title>

<script type="text/javascript">

var index = 1;

function scroll_right(){

index = index + 1;

if(index > 3){

document.getElementById('img_list').scrollLeft -= 300;

index = 1;

}

else{

document.getElementById('img_list').scrollLeft += 100;

}

}


function scroll_left(){

index = index - 1;

if(index < 1){

document.getElementById('img_list').scrollLeft += 300;

index = 3;

}

else{

document.getElementById('img_list').scrollLeft -= 100;

}

}

</script>

</head>

<body>

<table>

<tr>

<td colspan="3">title</td>

</tr>

<tr>

<td></td>

<td>

<div id="img_list" style="width:300px; height:100px; overflow:hidden;">

<table class="" width="500" align="center" cellpadding="0" cellspacing="0">

 <tr>

 <td><img src="http://superkts2.img.paran.com/icon/img001.gif"></td>

 <td><img src="http://superkts2.img.paran.com/icon/img002.gif"></td>

 <td><img src="http://superkts2.img.paran.com/icon/img003.gif"></td>

 <td><img src="http://superkts2.img.paran.com/icon/img004.gif"></td>

 <td><img src="http://superkts2.img.paran.com/icon/img005.gif"></td>

 </tr>

</table>

</div>

</td>

</tr>

<tr>

<td colspan="3">

<input type="button" name="" value="LEFT" onclick="scroll_left()"> <input type="button" name="" value="RIGHT" onclick="scroll_right()">

</td>

<tr>

</table>

</body>

</html>