Archived topic
Open menu with click on image in page
5 replies · Started by Arved on January 31, 2021
Hello,
Is it possible to unfold/un-collapse the menu with clicking on an image on the page? (Not talking about images within the menu)
Website: https://arvedgintenreiter.com
In desktop view the menu on my website is unfolded all the time. In mobile view the menu is collapsed - as it should be.
In mobile view I'd prefer to unfold the menu as it does now with clicking on it and additionally also when somebody clicks the main image on the page.
Is that even possible, maybe with adding an action to the functions?
Would be happy if somebody has an idea how this could be solved.
Thanks and best,
Arved
Hi there,
It should be possible with scripting.
You can assign a "click" eventListener to an image element so when the image is clicked, it opens up the menu.
Thanks Elvin for your quick reply,
Might be beyond my capabilities but I will try :)
To point you to a direction, try reading about these:
https://www.w3schools.com/jsref/met_element_addeventlistener.asp
https://www.w3schools.com/jsref/met_html_click.asp
No problem. :)
Thank you, Elvin!
No problem. :)