Fade option in show() and hide() methods not working

Question:
Fade Option is not working. What am I doing wrong?

Product:
[Which editor or feature is your question most relevant to? Wix Editor and Wix Studio

Also have this problem.

Generally, animations don’t work in Preview mode but should work on the Live site. I’ve left “fade” in my code and some users report seeing it while others don’t. It may also depend on the device type and browser used to view.

Hi, Michael_Watts !!

I tried writing similar code and experimenting with it myself. Indeed, your code doesn’t seem to execute the fade action. However, I found that it works correctly when the duration is shortened. Upon checking the Velo API documentation, I discovered that the duration can be set from 0s to 4000ms, and the delay can be set from 0s to 8000ms. If you need a longer fade action, you may need to use other methods, such as utilizing global.css. For now, though, I believe we’ve identified the reason why the current code isn’t working! :wink: :raised_hands: :raised_hands:

https://dev.wix.com/docs/velo/api-reference/$w/image/hide

2 Likes

Thank you @onemoretime very, very much. I looked at the docs, but did not see the 4 second max duration for the fade effect. When I made that change everything worked as desired. Thank you very, very much. You saved me from losing a client :slight_smile:

Check the effectOptions in the Method Parameters.
Within the FadeEffectOptions, you’ll find the following details:

  • Delay:

    • Valid values: 0-8000 milliseconds
    • Defaults to 0 milliseconds
  • Duration:

    • Valid values: 0-4000 milliseconds
    • Defaults to 1200 milliseconds

In any case, I’m glad it worked out! Enjoy Wix! :wink: :raised_hands: :raised_hands: