I’m trying to create a map with about 35 Location Pin (button) where each pin pops-up a menu (a group of about 7-8 buttons).
I want to achieve an effect; when a Location Pin is hovered, its respective menu to pop-up and rest all other menus to hide… as shown in the video below.
My problem is; there are 34 Pin’s menu should hide when one Pin is hovered. That means, I need to write code for all those 34 element to hide 34 times (34 x 34= 1156 line code) … it’s a lot of code.
Is there a way I can achieve this with a simple approach?
where with one line code I can hide all the 34 items.
Here is the sample code that I started writing but than I realised it would 1,156 line code… its too much.
export function Penedesbutton_mouseIn(event) {
$w(‘#PenedesBox’).show()
$w(‘#PenedesLine’).show()
$w(‘#PladeBagesBox’).hide()
$w(‘#PladeBagesLine’).hide()
$w(‘#PrioratBox’).hide()
$w(‘#PrioratLine’).hide()
}
// ---------- Priorat (DOCa) ---------- //
export function PrioratButton_mouseIn(event) {
$w(‘#PrioratBox’).show()
$w(‘#PrioratLine’).show()
$w(‘#PenedesBox’).hide()
$w(‘#PenedesLine’).hide()
$w(‘#PladeBagesBox’).hide()
$w(‘#PladeBagesLine’).hide()
Thanks,
Pawan