SOLVED: How to make text disappear/appear after a period of time using Dev Tools

Hi,

I’ve recently started a website and I would like to make some text dissapear after 5 seconds after the site loads, and then some new text that was hidden, should appear on the site, anyone have an idea of how I can do that?
This was my attempt that didn’t work.

// API Reference: https://www.wix.com/corvid/reference
// “Hello, World!” Example: https://www.wix.com/corvid/hello-world

$w.onReady( function () {

setInterval( function (){ $w( "#text55" ).hide( "fade" , ) },  0 ); 

setInterval( function (){ $w( "#text23" ).hide( "fade" , ) },  5000 ); 

setTimeout( function (){ $w( "#text55" ).show( "fade" , ) },  6000 ); 

});

The second (setInterval( function (){ $w( “#text23” ).hide( “fade” , ) }, 5000 ):wink: line of code in the first function works as expected text dissapears after 5s, but then the text that is supposed to apear at second 6 appears only for 1second and then dissapears, while I was expecting it to stay on the page for a specific time, which I do not how to set to be honest, someone pls help.

Thanks,
Alex

I don’t know what exactly you’re trying to do, but your current code means:
hide text55 every 0 milliseconds (meaning ALWAYS )
and show it after 6 seconds (something that is in conflict with the previous function).
I would expect this code to show one time 6 seconds after page load and then immediately disappear.
If you describe what exactly you’re trying to achieve, maybe we’ll be able to advise.

I am trying to achieve something like a slider, but instead of having different images as a background, I want my video to play in the background while the text changes by itself.

Something like this "www.youtube . com/watch?v=1CZhGDU5cWM"but instead of the slide left/right buttons I want it to slide by itself, and also so it doesnt change its background, so basically all the things that I want from the slider is just the text that changes, only I want it to change by itself, no buttons, and always the same background, which in my case will be a video.
Also I thought of just getting a slider and putting the video there, but I don’t know about the timing and I dont want it to play from the start everytime.

Sorry if I didn’t explain how I should’ve

Also it does what you said it appears every 6 seconds, but I want to hide it at the start, and after the side loads wait 6 seconds and show the text, then wait 6 seconds to hide the text meaning after 12 seconds after the load the texct should dissapear, then another text should appear

https:// damiankeyes . com, something like he has as you can see in the middle “Power you music career”, that text should dissapear and some other text should appear then dissapear

@cazacovalex5 so do something like

$w.onReady(() => {
$w("#text55").hide();
setTimeout(showAndHide, 6000);
})

function showAndHide(){
$w("#text55").show().then(() => {
	setTimeout(() => {$w("#text55").hide()}, 6000);
})
}

@jonatandor35 Thank you so much, it works, the element needs to be by default hidden, ← in case anyone ever needs to do something like this!

Thanks again!:smile:

you’re welcome :slight_smile: