Hi Boranet,
For that you will need to make use of the "Selected" state:
1. Provide style settings for "Selected" state. It can be the same as "Hover" state or something different. That's up to you;
2. Switch the menu item into "Selected" state after it is clicked;
To complete the first step, you simply use the Menu Builder. To complete the second step, there are a number of options for different scenarios:
1. If you use NavigateUrl, then you can set this property to NavigateUrl:
http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.BaseNavigator.AutoSelectSource.html2. If you use server events, you can use the following code in your server side event handler to set the item's Selected to true:
Code: C#
private void Menu1_ItemClick(
object sender, EO.Web.NavigationItemEventArgs e)
{
e.MenuItem.Selected = true;
}
3. If you do not use serer events, you can handle ClientSideOnItemClick:
Code: JavaScript
function item_click_handler(e, info)
{
info.getItem().setSelected(true);
}
Once you have those in place, every time a menu item is clicked, it is switched into Selected state thus applies SelectedStyle. One thing that you want to keep in mind is that setting one item's Selected to true
does not clear another item's Selected ---- a single menu can have multiple Selected item. So you may want to put in additional code to clear the previous selected item when you set a new selected item.
Thanks