设一个全局变量:
<script>
var currentChoice=true;
function check(){
if(currentChoice){
...//改变帧结构和图片的src属性
}else{
...//改回原来的帧结构和src
}
currentChoice=!currentChoise;
}
</script>
<img id=xxx src=a.gif onclick=check()>
<script>
var currentChoice=true;
function check(){
if(currentChoice){
...//改变帧结构和图片的src属性
}else{
...//改回原来的帧结构和src
}
currentChoice=!currentChoise;
}
</script>
<img id=xxx src=a.gif onclick=check()>
....
<div id=b>
...
<script language='javascript'>
function onclick_a(){
a.stype.display=""
b.stype.display=none
}function onclick_b(){
b.stype.display=""
a.stype.display=none
}</script>
只是我不知道在JavaScript中图片的src属性是如何修改(赋值)的?也查不到NSDN的帮助。