Hello! I’d appreciate some help as my website home page is taking too long to load the code below:
$w.onReady(()=>{
let sentence1 = $w('#textHome1');
let sentence2 = $w('#textHome2');
let sentence3 = $w('#textHome3');
let sentence4 = $w('#textHome4');
let floatDir = {
"direction": "left"
};
let floatEsq = {
"direction": "right"
};
for (i=0;i<100;i++){
setTimeout(()=>{sentence1.hide('float',floatDir)},i*14000+5500)
setTimeout(()=>{sentence2.hide('float',floatEsq)},i*14000+5500)
setTimeout(()=>{sentence3.show('float',floatEsq)},i*14000+7000)
setTimeout(()=>{sentence4.show('float',floatDir)},i*14000+7000)
setTimeout(()=>{sentence3.hide('float',floatDir)},i*14000+12500)
setTimeout(()=>{sentence4.hide('float',floatEsq)},i*14000+12500)
setTimeout(()=>{sentence1.show('float',floatEsq)},i*14000+13500)
setTimeout(()=>{sentence2.show('float',floatDir)},i*14000+13500)
};
})
It was taking about 6 seconds to begin the “For” loop iteration, so I removed the members area and it came down to 2,5 seconds, then I removed the “Search” option and it came down to 1 - 1,5s, is there any way to load it faster without having to sacrifice those features in my website?
Obs.: I also got some code for the header as I made a customized submenu:
export function buttonPecas_mouseIn(event) {
$w('#box7').show();
$w('#vectorImage4').show();
}
export function box8_mouseOut(event) {
$w('#box7').hide();
$w('#vectorImage4').hide();
}
export function box9_mouseOut(event) {
$w('#box7').hide();
$w('#vectorImage4').hide();
}
export function box7_mouseOut(event) {
$w('#box7').hide();
$w('#vectorImage4').hide();
}
Thanks in advance!