它为什么不起作用?我想点击next.jpg并且看到,2.png消失并且1.png出现。脚本不支持img
<html>
<head>
<script type="text/javascript">
function next(id)
{
var callend = document.getElementById('c' + id).style;
callend.display = 'none';
id++;
var callend2 = document.getElementById('c' + id).style;
callend2.display = 'inline';
}
}
</script>
</head>
<body>
<img src="next.jpg" onclick="next(1)" >
<img id="c1" border="0" style="display: inline" src="2.png" usemap="#map2">
<img id ="c2" border="0" style="display: none" src="1.png" usemap="#map1">
........
编辑:如果你缩进你的代码,你会看到错误,您正在使用的功能的结束
您有一个额外的'}'你的函数的末尾。 – Stilltorik