Question:
[ I’m working on a project where I need to programmatically close an accordion in Wix Velo after a menu selection has been made and displayed via code. I’ve been trying to find a method to do this, but so far I haven’t had any luck.
Here’s what I’ve tried:
Using a method like close() on the accordion, like so: $w(“#myAccordion”).close(). However, it seems that there’s no close() method available for the accordion.
I also tried closing a container within the accordion, but this didn’t give the desired result either.
Is it possible to programmatically close a selection once open on accordion in Wix Velo? If so, could you please guide me on how to achieve this?
Any help would be greatly appreciated. Thank you!
]
Product:
[ Wix Studio Editor.]
What are you trying to achieve:
[ programmatically close an accordion in Wix Velo after a menu selection has been made and displayed and later close it via code some way.]
Instead of trying out which methods and functions could work on your accordion, it would be much easier just simply navigate to the right article about ACCORDIONS, to check for their offered possibilities and see if you can use them or not…
Do you see somewhere → close()-function provided for ACCORDIONS ?
Do you recognize that ACCORDIONS gives you almost no possibilities for editing them by CODE ?
The only way which maybe could work is to use it’s CSS-options and manipulate the design, for example hiding a menu, setting it’s styles to transparent.
But this for you will have to check which possibilities are provided for CSS-manipulations.
In future just navigate to the VELO-API-DOCs open the docs for the right element of your choice and check what is POSSIBLE and what is NOT POSSIBLE, regarding the element of your choice.
And if any possibilities found —> you still can create your own ACCORDION, maybe 100x times better then provided by wix → if you can code.