Hi, First time posting here. I tried looking for help on this but couldn't find anything.
I am trying to create multiple buttons that open and close different strips with content on them when each button is clicked. I have uploaded a video below from another site with the exact way I would like this to work. Is this possible to do on with Corvid? If so could someone please help me with the code for this? I am a real newb to code. Thanks.
@givemeawhisky How can I make a second click of the same button close the strip without having the open and close code confuse each other?
Thanks for all your help givemeawhisky!!! After a couple hours of trial and error and reading through everything you gave me I figured it out. Awesome!!
Quick reply as not on for long.
Just looking at your code, have you simply copied and pasted it from the post above?
No worries if you have, however you actually need to use the properties panel for each element to add the event handler function to the code itself.
https://support.wix.com/en/article/corvid-working-with-the-properties-panel
https://support.wix.com/en/article/corvid-reacting-to-user-actions-using-events
You can change the code so that the event handler is written into the function itself and you don't actually need to add it through the properties panel for the element, however for yourself it is easier for you to add it from the properties panel for the button elements so that you are sticking to the one way of working and keeping it all simple for now.
Finally, as for the code start, you need to have your imports at the top of your code where you import anything that you have used like Wix Data, Wix Stores, Wix User, Wix Location, Wix Window, etc and then followed with the page onReady function, then you can have your functions for the strips.
https://www.wix.com/corvid/reference/$w.html#onReady
You can find more about it here too.
https://support.wix.com/en/article/corvid-working-in-the-code-panel#making-sure-the-element-has-loaded-before-you-reference-it
Yes you can do that.
You simply have the three strips for those three buttons setup as collapsed on load.
Then when the user clicks on the needed button, the collapsed strip can then be set in code to expand and show underneath the strip with the buttons in, whilst pushing down the strip below it with the video in it.
You can simply do this for each collapsed strip so that whichever one they click on to view, the actions will all be the same.
https://www.wix.com/corvid/reference/$w.CollapsedMixin.html
Wix tutorial for collapse and expand template.
https://www.wix.com/corvid/example/collapse-elements