为了账号安全,请及时绑定邮箱和手机立即绑定

代码只轮播了一次

代码只轮播了一次

qq_许一_0 2017-05-02 11:14:12
求解<!doctype html><html><head><meta charset="utf-8"><title>京东轮播图代码</title></head><body><div class="slider" id="circle"  style="width:790px; height:340px; overflow:hidden;"><a href="https://item.jd.com/11141344903.html#crumb-wrap" ><img src="images/zp (1).jpg" alt="" /></a><a href="http://xxbuyun.jd.com/"><img src="images/zp (2).jpg" styly="width:790px; height:340px" alt="" /></a><ul class="circle"><!--移动鼠标触发事件--><li onmouseover="lunbo(1)" id="1" >1</li><li onmouseover="lunbo(2)" id="2">2</li></ul><div class="arrow"><a href="javaScript:;" class="arrow-l" onclick="bo2()" id="bo1"></a><a href="javaScript:;" class="arrow-r" onclick="bo1()" id="bo2"></a></div></div><script>    var a = 1;    var t = 0;    window.onload = function(){    t = setInterval("bo1()", 2000);    }function lunbo(num){a = num;var btn = document.getElementById("circle").getElementsByTagName("img")[0];for (var i=1;i<3;i++) {var li = document.getElementById("circle").getElementsByTagName("li")[i-1];li.style.backgroundColor = "#3E3E3E"; if(num == i){btn.src = "img/"+i+"p.jpg";li.style.backgroundColor = "#B61B1F";}} }function bo1(){if(a==2){a = 1;}a++;lunbo(a);}function bo2(){if(a ==1){a = 2;}a--;lunbo(a);}</script></body></html>
查看完整描述

1 回答

?
慕神6131772

TA贡献10条经验 获得超6个赞

发问题的时候,请选择内容框上的代码语言,然后整理好格式。你这样的格式,真心懒得看。

查看完整回答
反对 回复 2017-08-15
  • 1 回答
  • 0 关注
  • 1163 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信