<!DOCTYPE html PUBLIC "
<html xmlns="
<head>
<meta http
<script type="text/javascript" src="js/jquery
<title>jq控制左右箭頭滾動圖片列表</title>
<style type="text/css">
*{ margin:
ul{ list
#slider_pic{ width:
#slider_pic li{float: left;margin
#slider_pic ul{position: absolute;left:
</style>
<script type="text/javascript">
$(function(){
var oPic=$(
var oImg=oPic
var oLen=oImg
var oLi=oImg
var prev=$("#prev");
var next=$("#next");
oPic
var iNow=
var iTimer=null;
prev
if(iNow>
iNow
}
ClickScroll();
})
next
if(iNow<oLen
iNow++
}
ClickScroll();
})
function ClickScroll(){
iNow==
iNow==oLen
oPic
}
})
</script>
</head>
<body>
<div class="slider">
<span class="prev no_click" id="prev"><<</span>
<span class="next " id="next">>></span>
<div id="slider_pic">
<ul>
<li><img src="
<li><img src="
<li><img src="
<li><img src="
<li><img src="
</ul>
</div>
</div>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20399.html