對不起,我在這裏遇到了一些特殊問題,可能對其他人沒有太大幫助。或者也許不知何故,它可能是,我不知道。我在隨機圖片的幻燈片中顯示的最終圖片不顯示
我一直在搞這個整晚,它在吹我的腦海,因爲圖像全部消失,因爲它們應該,一切都會改變,完全轉換到最後,最後的圖像會顯示「感謝您觀看「顯示,除非不是。這很奇怪,因爲標題像它應該是空白的,我甚至在圖像設置完成後運行警報,並且它會觸發。在我投入褪色之前,最終幻燈片正在顯示。所以我覺得這是因爲它被淡化了,所以我在它下面放了一個淡色,但是沒有做任何事。我不知道,我很茫然。
這是我的網站給你一個這裏發生了什麼的想法。 http://www.dreamquest.io
/* this is the first function that is fired though I've moved it after the next function just
to be chronological, but no luck with the issue at hand */
function removeImage(){
document.getElementById("all").onclick = "";
document.getElementById("remove").onclick = "";
$("#image").fadeTo(2000,0, changeImage);
}
function changeImage(){
var random = mix.pop();
var entry = backInfo[random];
if (random == undefined) {
document.getElementById("caption").textContent = "";
/* end.png is the last image in the slideshow that isn't showing up */
document.getElementById("image").src = "end.png";
$("#image").fadeTo(1000,1);
}
document.body.style.textShadow = "1px 1px 7px #000";
document.getElementById("all").style.backgroundImage = "url(" + entry.image + ")";
document.getElementById("image").src = entry.image;
document.getElementById("artist").href = entry.artist;
document.getElementById("caption").textContent = entry.caption;
if (random != undefined) {
/* I've even amde sure that random is in fact undefined at the last slide */
var image = new Image();
image.onload = function() {
$("#image").fadeTo(1000,1);
document.getElementById("all").onclick = removeImage;
document.getElementById("remove").onclick = removeImage;
}
image.src = entry.image;
}
}