• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Open/Close menu only working once

New Here ,
Jan 24, 2023 Jan 24, 2023

Copy link to clipboard

Copied

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.
problem1.PNGproblem2.PNG

Views

124

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2023 Jan 25, 2023

Copy link to clipboard

Copied

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2023 Jan 25, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources