Trigger RadMenu Dropdown with jQuery

I have a Dynamnic based Radmenu with drop down menus.

I want the user to click the image on the site (not the menu), and then automatically launch the dropdown menu from the Telerik menu using jQuery. Is it possible?

Client HTML is loaded after loading the site:

<div id="ctl00_RadMenu1" class="RadMenu RadMenu_Hay rmSized" style="width: 960px; left: 0px; top: 0px; z-index: 10000; "> <ul class="rmRootGroup rmHorizontal"> <li class="rmItem rmFirst"> <a href="http://test.com" class="rmLink rmRootLink"><span class="rmText rmExpandDown">Test Dropdown 1</span></a> <div class="rmSlide"> <ul class="rmVertical rmGroup rmLevel1"> <li class="rmItem rmFirst"> <a href="http://test.com" class="rmLink"><span class="rmText">Dropdown Item 1</span></a> </li> </ul> </div> </li> </ul> </div> 
+4
source share
2 answers

I think you are looking for this ...

 $('#theImage').click(function(){ var menu = $find("<%= RadMenu1.ClientID %>"); var item = menu.findItemByText('Test Dropdown 1'); if (item) { item.open(); } else { alert('the item ' + text + ' was not found'); } }); 

You can learn more about this here: http://www.telerik.com/help/aspnet-ajax/menu-client-side-basics.html

+2
source

you can try jquery trigger http://api.jquery.com/trigger/

  $(".rmLink").trigger('click'); 
0
source

Source: https://habr.com/ru/post/1444878/


All Articles