我有一个旋转文本和图像的脚本。我想在翻转时暂停其功能,并在推出时继续。以下是代码。请帮助或建议。
$(document).ready(function(e) {
function nextMsg(i) {
if (messages.length == i) {
i = 0;
}
$('#message').html(messages[i]).fadeIn(500).delay(5000).fadeOut(500, function() {
nextMsg(i + 1);
});
};
var messages = [
"Hello! <img src='../images/employees/01.png' />",
"This is a website!<img src='../images/employees/02.png' />",
"You are now going to be redirected.<img src='../images/employees/03.png' />",
"Are you ready?<img src='../images/employees/04.png' />",
"You're now being redirected...<img src='../images/employees/05.png' />"
];
$('#message').hide();
nextMsg(0);
});