Fade out code not working

Hi, I have a scroll down text on top of a stripe on my website and I want it to disappear after a few seconds while I scroll down. I have did some research on the blog and found the line of code I have added in my editor. But it’s not working. Any idea why?

Screen elements are not accessible from the file itself. You need to put your code in the page’s onReady() function. Something like this:

$w.onReady(function () {
   let fadeOptions = {
      "duration":   2000,
      "delay":      1000
   };
   $w("#text36").hide("fade", fadeOptions);
})

For more information about the page’s onReady() function, see the following:

  • $w.onReady() :: a guide for the perplexed

  • $w.onReady() API

I recommend continuing your research and getting familiar with Velo. To learn about programming with Velo, read the following articles that will help you get started:

  • About Velo by Wix - what Velo is and what features it has.

  • Getting Started with Velo by Wix - step-by-step tutorial on how to start using Velo.

  • Onboarding to Velo by Wix - introduction to Velo with short tutorials.

  • Velo Examples - has many examples demonstrating a wide variety of features and techniques. Filter by “Beginner” to get started.