start/stop이 이미지 슬라이드쇼도 함께 제어하도록 수정한다.
기존에는 음악 음소거만 바뀌어 롤링이 멈추지 않던 문제를 고친다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -246,18 +246,36 @@ function onLoad() {
|
||||
|
||||
|
||||
function toggle() {
|
||||
if (!document.getElementById('betoven').muted) {
|
||||
document.getElementById('betoven').muted = true;
|
||||
var audio = document.getElementById('betoven');
|
||||
var gallery = window.dreamgirlGallery;
|
||||
var isRunning = gallery
|
||||
? !!gallery.isSlideshowRunning
|
||||
: !!(audio && !audio.muted);
|
||||
|
||||
if (isRunning) {
|
||||
if (audio) {
|
||||
audio.muted = true;
|
||||
try { audio.pause(); } catch (e) {}
|
||||
}
|
||||
if (gallery && typeof gallery.pause === 'function') {
|
||||
gallery.pause();
|
||||
}
|
||||
clearInterval(refreshIntervalId);
|
||||
refreshIntervalId = null;
|
||||
$("#toggle").html("start");
|
||||
} else {
|
||||
document.getElementById('betoven').muted = false;
|
||||
/*
|
||||
refreshIntervalId = setInterval(function() {
|
||||
var index = Math.floor(Math.random()*278) + 1;
|
||||
$("#thumbs").html("<img src='"+pictures[index]+"' width='100%' onerror=\"this.src='"+imgurl+"z7jP92.jpg'\"/>");
|
||||
}, 3000);
|
||||
*/
|
||||
if (audio) {
|
||||
audio.muted = false;
|
||||
try {
|
||||
var playPromise = audio.play();
|
||||
if (playPromise && typeof playPromise.catch === 'function') {
|
||||
playPromise.catch(function () {});
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
if (gallery && typeof gallery.play === 'function') {
|
||||
gallery.play();
|
||||
}
|
||||
$("#toggle").html("stop");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user