Skip to main content
New Participant
January 24, 2023
Question

Open/Close menu only working once

  • January 24, 2023
  • 2 replies
  • 347 views

Hi
I have created a simple slide in slide out menu. But for some reason the script only run once. I have tried to used variables to "reset" the script but no luck. What am I missing? One script are on one open button and the other on another close button.

    This topic has been closed for replies.

    2 replies

    Paul Wilson CTDP
    Brainiac
    January 25, 2023

    I suspect this is because of the effect you selected. I recorded a video on how I would have handled this particular challenge: https://youtu.be/u-QmKt3SPdI

    Paul Wilson, CTDP
    New Participant
    January 26, 2023

    Wow. This must be the best respond in my internet career 🙂
    Thank you for taking the time. I think I forgot to reset the variable to 0 in the else part. Thank you

    Lilybiri
    Brainiac
    January 25, 2023

    I suspect you are using the default motion effects, and the issue may be there. It is really necessary to use custom motion paths instead of those canned ones. Maybe have a look at the example in this blog post:

    https://blog.lilybiri.com/sliding-menu

    It is not easy to explain the reason for this change. But Fly in from and Fly out both set up the motion path from the location of the object which is on the end position for Fly in, and on the start position for Fly out. Whereas you need a relative motion path from the eact situation the object has before moving.

    You need to prevent also that the same button is clicked twice in sequence. That could be done by disabling the Open button when the menu is open, and similar for the Close button.