嘿,我一直在试图弄清楚如何在单击按钮后将其重置为之前的状态时遇到了一些困难。我知道这涉及到一个 javascript 时间,任何人都可以帮助我现在整个早上都在尝试。
function clickMute()
{ if (document.Mute.src=='http://www.showandtell.com/TRUMusicControl/images/BeforeClickMute.png'){
document.Mute.src='http://www.showandtell.com/TRUMusicControl/images/AfterClickMute.png';
}
else if (document.Mute.src=='http://www.showandtell.com/TRUMusicControl/images/AfterClickMute.png'){
document.Mute.src='http://www.showandtell.com/TRUMusicControl/images/BeforeClickMute.png';
}
}
<div id= "Mute">
<a href="#">
<img id="Mutebutton" name="Mute" onclick="clickMute()" src="images/BeforeClickMute.png" width="140" height="126" />
</a>