Streaming live at 10am (PST)

Opening/closing the sliding sidebar with the same button while keeping a separate button just to close it

I am trying to implement a sidebar as show on example 4 on the interaction page, with the difference that on the second click of the same button I would like the side bar to close.

So in essence:

  • The first click of the ‘Login’ button would open the sidebar. (Nothing unusual here)
  • The second click of this button would
    close the sidebar (This is different to your example)
  • And there is an ‘X’ button on
    the sidebar to close it (similarly to your example)

If I open the sidebar with the ‘Login’ button, then close it with the ‘X’ button, the ‘Login’ button takes two clicks to open the side bar again.

I assume this is because I am assigning two separate scripts for the two buttons, and at this point the ‘Login’ button is expecting the ‘second click’,which is set up to close the sidebar and not to open it. Yet, I don’t know what to do about it. Is there different way of doing this so this does not happen? I tried to link the ‘X’ button to the first script and just use one script, but that resulted in having to press the ‘X’ button twice to close the sidebar.


1 Like

Usually have the same problem in some situations. In webflow think there is no solution. What I do is go to the developer to do the job! :smile:

I could do that thanks to some coding stuff. Contact me using details provided in my profile and we’ll figure it out :)

1 Like

Thanks both. I guess I could write a custom javascript to do all of this too, but I was hoping there was a simple fix with the webflow scripts…

hi guys ! where i can find this code ? plz help me …

I found a solution for that:

2 interactions:
one opens and makes visible the bt close
another closes and makes visible the bt open

The login button, it opens the flap and exchange bt login with one with the interaction of closing.

[Bt open] … [bt close hidden]
[Bt close] … [bt open hidden]

The close button he shuts the tab and change the login bt for which only triggers the open.

You get the idea?