This is a migrated thread and some comments may be shown as answers.

[Solved] MVC Parent Menu Item Hover Event Show Parent Page.

1 Answer 21 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Charles
Top achievements
Rank 1
Charles asked on 30 Apr 2012, 05:07 PM
I am having trouble getting the MVC Razor Menu to behave the way I want it too. The desired behavior is when the parent menu item is hovered over I want to show a ceratin webpage pased on the menu item. Example: The Home button should show the /Home, the About should show /About, ect... I am using the menu.Add().Text("Home").Action("Index", Home); to control the click behavior. I want the hover to behave just like the click behavior except just show the correct form unless clicked on. Can anyone help me with this?

Thanks,

W.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 03 May 2012, 11:20 AM
Hello,

You can achieve the desired behavior by executing the following script in the Menu's OnLoad client event.

$(this).find("a.t-link").hover(function(){
    document.location.href = this.href;
});

I am not sure what exactly your scenario is, but generally, navigating to another page on mouse over is extremely bad practice in terms of usability and user experience. I recommend you to not use this approach.

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Menu
Asked by
Charles
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or