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

有没有学长可以帮忙挑挑错

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>


kerwinz
浏览 1751回答 3
3回答

wowbruce

用循环 你这样要累死滴

荼酒

看你写的我也是醉了~
打开App,查看更多内容
随时随地看视频慕课网APP