使用浏览器上的后退按钮访问页面时,以下脚本不会触发。无论页面访问方式如何,都有办法解雇它吗?
window.onload = function() {
var quotes = $(".head-banner");
var quoteIndex = -1;
function showNextQuote() {
++quoteIndex;
quotes.eq(quoteIndex % quotes.length).fadeIn(1500).delay(4500).fadeOut(1500, showNextQuote);
}
showNextQuote();
}();
/* Background Transitions */
window.onload = function() {
var images = ["https://unsplash.it/1800/1600?image=1006", "https://unsplash.it/1800/1600?image=1008"];
var imageIndex = -1;
function showNextImage() {
++imageIndex;
var imgUrl = images[imageIndex % images.length];
$('#header').css('background-image', 'url(' + imgUrl + ')');
$('#header').fadeIn(1500).delay(4500).fadeOut(1500, showNextImage);
}
showNextImage();
}();
编辑:自发布以来我已经了解了旋转木马是什么