【发布时间】:2013-11-10 21:44:19
【问题描述】:
$(".sound").click(function() {
if ($(".intro-movie").prop('muted', true)) {
$(".intro-movie").prop('muted', true);
$(".sound").addClass("muted");
} else {
$(".intro-movie").prop('muted', false);
$(".sound").removeClass("muted");
}
});
试图让声音图标“.sound”在点击时静音或取消静音 html5 视频“.intro-movie”。
【问题讨论】:
-
也许你的
if ($(".intro-movie").prop('muted', true))必须是if ($(".intro-movie").prop('muted', false))。现在看来: if(muted) then mute else unmute
标签: javascript jquery html video