我的页面上有两个 ImageButton。单击一个后,我想隐藏它并显示另一个。我目前的代码是:
var button_mute = document.getElementsByID("ImageButtonMute");
var button_unmute = document.getElementsByID("ImageButtonUnmute");
function mute() {
vid_left.mute();
vid_right.mute();
button_mute.style.display = "block";
button_unmute.style.display = "none";
}
function unmute() {
vid_left.unMute();
vid_right.unMute();
button_mute.style.display = "none";
button_unmute.style.display = "block";
}
<asp:ImageButton ID="ImageButtonMute" runat="server"
ImageUrl="~/icons/volume_mute_small.png" OnClientClick="mute()" />
<asp:ImageButton ID="ImageButtonUnmute" runat="server"
ImageUrl="~/icons/volume_unmute_small.png" OnClientClick="unmute()" />
我没有在后面的代码中引用任何一个,我不确定为什么这不起作用。任何帮助表示赞赏,谢谢。