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

我写了一段js,但是不管用,不知道是哪里错了

我写了一段js,但是不管用,不知道是哪里错了

kerwinz 2015-11-10 15:59:04
有没有学长可以帮忙挑挑错js+hem如下:<script type="text/javascript">var xiaoshou = document.getElementById("xiaoshou");var baoyang = document.getElementById("baoyang");var qixiu = document.getElementById("qixiu");var meirong = document.getElementById("meirong");var jiayou = document.getElementById("jiayou");function xiaoshou(){ xiaoshou.style.display = "block"; baoyang.style.display = "none"; qixiu.style.display = "none"; meirong.style.display = "none"; jiayou.style.display = "none"; } function baoyang(){ xiaoshou.style.display = "none"; baoyang.style.display = "block"; qixiu.style.display = "none"; meirong.style.display = "none"; jiayou.style.display = "none"; } function qixiu(){ xiaoshou.style.display = "none"; baoyang.style.display = "none"; qixiu.style.display = "block"; meirong.style.display = "none"; jiayou.style.display = "none"; } function meirong(){ xiaoshou.style.display = "none"; baoyang.style.display = "none"; qixiu.style.display = "none"; meirong.style.display = "block"; jiayou.style.display = "none"; } function jiayou(){ xiaoshou.style.display = "none"; baoyang.style.display = "none"; qixiu.style.display = "none"; meirong.style.display = "none"; jiayou.style.display = "block"; }</script><div><span><a href="javascript:void(0);" Onclick="xiaoshou()"><img src="tu_49.png"/></a></span><span><a href="javascript:void(0);" Onclick="baoyang()"><img src="tu_51.png"/></a></span><span><a href="javascript:void(0);" Onclick="qixiu()"><img src="tu_53.png"/></a></span><span><a href="javascript:void(0);" Onclick="meirong()"><img src="tu_55.png"/></a></span><span><a href="javascript:void(0);" Onclick="jiayou()"><img src="tu_57.png"/></a></span><div><span id="xiaoshou" style="display:block;"><img src="xiaoshou.png"></span><span id="baoyang" style="display:none;"><img src="baoyang.png"></span><span id="qixiu" style="display:none;"><img src="qixiu.png"></span><span id="meirong" style="display:none;"><img src="meirong.png"></span><span id="jiayou" style="display:none;"><img src="jiayou.png"></span></div></div>
查看完整描述

3 回答

?
wowbruce

TA贡献2条经验 获得超0个赞

用循环 你这样要累死滴

查看完整回答
反对 回复 2015-11-10
  • kerwinz
    kerwinz
    我原先也想用啊,但没有研究出来就直接写了
?
荼酒

TA贡献133条经验 获得超96个赞

看你写的我也是醉了~

查看完整回答
反对 回复 2015-11-10
点击展开后面1
  • 3 回答
  • 0 关注
  • 1749 浏览
慕课专栏
更多

添加回答

举报

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