Commit 775291f4 authored by Michael Iseard's avatar Michael Iseard
Browse files

Set initial timeout to 3s

parent 7bae8fdc
export default {
init() {
// JavaScript to be fired on the home page
let $introTarget = $('#intro-variable');
let introArray = $('.intro-text').data('list');
let index = 0;
let total = introArray.length;
changeText(introArray);
function changeText(introArray) {
setTimeout(() => {
$introTarget.toggleClass('swap-out swap-in');
setTimeout(() => {
$introTarget.toggleClass('swap-out swap-in');
$introTarget.text(introArray[index])
}, 500)
index++;
if(index === (total)) {
index = 0;
init() {
// JavaScript to be fired on the home page
let $introTarget = $('#intro-variable');
let introArray = $('.intro-text').data('list');
let index = 0;
let total = introArray.length;
changeText(3000);
function changeText(timeout)
{
setTimeout(() => {
$introTarget.toggleClass('swap-out swap-in');
setTimeout(() => {
$introTarget.toggleClass('swap-out swap-in');
$introTarget.text(introArray[index])
}, 500)
index++;
if (index === (total)) {
index = 0;
}
changeText(5000);
}, timeout);
}
changeText(introArray);
}, 5000);
}
},
finalize() {
// JavaScript to be fired on the home page, after the init JS
},
},
finalize() {
// JavaScript to be fired on the home page, after the init JS
},
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment