我正在努力实现以下体验:
在元素完全隐藏之前,文本正在发生变化。这是在页面加载时运行的函数...
var welcomeText = function() {
var welcome = ["Bienvenue.", "Willkommen.", "Benvenuto.", "Bienvenido.", "Welkom", "欢迎", "Fáilte.", "Nau mai", "Welcome."],
title = $(".home-title"),
counter = 0;
setInterval(function() {
title.animate({"bottom":"-100%"},200);
title.text(welcome[counter]);
counter++;
title.animate({"bottom":""},200);
if(counter >= welcome.length) {
counter = 0;
}
}, 3000);
}