Welcome Guest Search | Active Topics | Sign In | Register

SlideMenu - Change Color on MenuItem Clicked Options
mendy
Posted: Thursday, May 27, 2010 2:42:03 PM
Rank: Member
Groups: Member

Joined: 5/27/2010
Posts: 22
Hi,

I'm trying to change the color of a MenuItem when Clicked, and alternate the color change when a different item is clicked for that Submenu group , and I haven't been able to find the property for it.

Is there one, or do I need to use code behind?

Thanks.
eo_support
Posted: Thursday, May 27, 2010 2:51:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to edit the menu item's Selected state to have a different background color, then use JavaScript code to switch the menu item to Selected state when clicked.

You can find more information about menu item state here:

http://doc.essentialobjects.com/library/1/menucommon/styleandappearance/item_state.aspx

About how to handle menu item click event with JavaScript:

http://doc.essentialobjects.com/library/1/menucommon/handlingevent/client_event.aspx

And all the available client side objects/methods:

http://doc.essentialobjects.com/library/1/clientapi_howto.aspx

You can also do it through code behind but because it requires a post back, the user experience won't be as good as doing it on client side.

Hope those helps.

Thanks!
mendy
Posted: Friday, May 28, 2010 9:31:59 AM
Rank: Member
Groups: Member

Joined: 5/27/2010
Posts: 22
Hi,

I was not able to get the JavaScript to work with the Slidemenu, The examples work with a regular Menu. Maybe you can send an example please.

However , I was able to do it from code behind, and being that I am using a callback panel , I simply included the slidemenu in the group for the callback, and it works fine without another callback.

Thank you for your advice!
eo_support
Posted: Friday, May 28, 2010 10:11:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The code for slide menu should be the same except for that Menu and SlideMenu interprets the "Selected" state slightly differently. Menu will never automatically switch an item to Selected state. However for Slide Menu, the top level item automatically enters Selected state when it is expanded. This also means if you wish to "Select" top level slide menu items, you must call expandSubMenu to expand it. If you continue to have problem, please create a test page with your code and we will be happy to take a look.

Doing it inside a CallbackPanel is a good alternative though.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.