Make menu item stay after click?

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

Make menu item stay after click?

#1

Postby edwinayin@qq.com » Fri Nov 25, 2016 8:46 pm

Hello,

I am new to ebase. Currently, my sub menu items will appear with hover effect and disappear when loses focus. Is there a way to make the sub menu items stay after clicked and disappear after clicked elsewhere?

Thanks in advance!!
Edwina
0 x

dan
Ebase User
Posts: 8
Joined: Mon Jan 14, 2013 9:49 am

showing selected submenus

#2

Postby dan » Mon Nov 28, 2016 12:58 pm

Hi,

If i understand you correctly: this isn't directly possible through ebase with a simple click of a button, but you can leverage jQuery from within ebase and this might give you something like the result you want.

1. Add a jQuery library to your form(s)

see This Vault Snippet for an introduction for using jquery in ebase.

2. In the designer, with the form open, for each page that the menu appears right click on the page in the outline view and select "Html Element Properties" from the menu.

a) Give the page an id (or class) - e.g. 'MyPage'
b) Under the jQuery tab select click from the drop down and then in the code section (click on the ... button) add the following:

Code: Select all

       // remove any previously selected blocks
        $ebase("div.mymenu").find("ul.[class*='SubLevel'], [display='block']").css("display", "");

and press OK.

c) In the "Html Element Properties" dialog under the jQuery tab press the green + to add a new line, select ready from the dropdown and add the following:

Code: Select all

        // this will make the sub menu appear after it has been selected
        $ebase("div.mymenu").find("li.eb-ItemSelected").parents("ul.[class*='SubLevel']").css("display", "block")

I think this gives the results you are looking for, I haven't given it much of a test, but I hope it helps at least.
0 x
Dan

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

showing selected sub-menu

#3

Postby edwinayin@qq.com » Mon Nov 28, 2016 2:22 pm

Thank you so much, Dan, it worked perfectly!!

regards,
Edwina
0 x


Who is online

Users browsing this forum: No registered users and 56 guests