js 脚本切换图片循环
<script language="javascript">
var img_width = 120;
var img_size = 0;
var cur_s_w = 0;
function install_slide(images) {
img_size = images.length;
var thumbs = document.getElementById("thumbs");
var html = "";
for (var i = 0; i < images.length; ++i) {
if (!images[i]) break;
html += "<a href='#' id='_slide_"+i+"' onclick='showImage(\""+images[i][1]+"\", this);return false;'><img src=\""+images[i][0]+"\" width=\"150px\" height=\"80px\" /></a>";
(new Image()).src=images[i][1];
}
thumbs.innerHTML = html;
if (images.length > 0) {
showImage(images[0][1], document.getElementById("_slide_0"));
}
}
function showImage(img, src) {
document.getElementById("picshow").innerHTML = "<img src=\""+img+"\" class='picshow_area'/>";
var thumbs = document.getElementById("thumbs");
if (thumbs._current) thumbs._current.className = "";
src.className = "current";
thumbs._current = src;
}
function stepSlide(right) {
var thumbs = document.getElementById("thumbs");
var left = parseInt(thumbs.style.left);
if (!left) left = 0;
var step = right ? -180 : 180;
left += step;
if (left > 0) left = 0;
if(cur_s_w<thumbs.parentNode.scrollWidth){cur_s_w = thumbs.parentNode.scrollWidth;}
if (thumbs.scrollWidth + left < thumbs.parentNode.clientWidth) {
left = thumbs.parentNode.clientWidth - cur_s_w;
}
$("#thumbs").animate({'left' : left }, 180);
}
function moveSlide(right) {
var thumbs = document.getElementById("thumbs");
thumbs._move_step = right * (-10);
if (thumbs._move_interval) {
clearInterval(thumbs._move_interval);
thumbs._move_interval = null;
}
thumbs._move_interval = setInterval("moveSlide0()", 20);
}
function stopMoveSlide() {
var thumbs = document.getElementById("thumbs");
if (thumbs._move_interval) {
clearInterval(thumbs._move_interval);
thumbs._move_interval = null;
}
}
function moveSlide0() {
var thumbs = document.getElementById("thumbs");
var end = false;
var left = parseInt(thumbs.style.left);
if (!left) left = 0;
left += thumbs._move_step;
if (thumbs.parentNode.clientWidth - left > thumbs.scrollWidth) {
left = thumbs.parentNode.clientWidth - thumbs.scrollWidth;
end = true;
}
if (left > 0) {
left = 0;
end = true;
}
thumbs.style.left = left + "px";
if (end) {
clearInterval(thumbs._move_interval);
thumbs._move_interval = null;
}
}
install_slide(
[
<%
for (int j = 0; j < otherpic.Length-1; j++)
{
if((j+1)!=otherpic.Length-1)
{
%>
["<%=otherpic[j] %>", "<%=otherpic[j] %>"],
<%}
else{ %>
["<%=otherpic[j] %>", "<%=otherpic[j] %>"]
<%}} %>
]
);
</script>
下面为效果的网址
http://www.oppo.com/index.php?q=mobile/product/newtpl&name=f15&tpl=shows
产品图片这个效果点击箭头是5张一起替换,我想变成一张一张的往下替换,然后到了最后一张,点击下一张跳到第一张,这段代码需要改什么