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

Radmenu in iFrame

1 Answer 136 Views
Menu
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 24 Jun 2012, 07:26 PM
Hi there

I have an AJAX Q10 Radmenu that I have to run in an Iframe on an ASPX page.  I know this it totally not ideal, but to cut a long story short, this is the only way that we can integrate it into the code and we would really like to use the Radmenu in this scenario.

I databind the Radmenu to the database with a lot of parent-child-child-child menus.  It runs perfectly in the Iframe, but sometimes, if you move the mouse fast over the iframe, the child will expand and not collapse after the mouse left the iframe.  So then you have an expanded radmenu sitting inside the iframe, and the only way to make it collapse, is to move the mouse over it again.

I tried changing the expand delay to a higher value, or make it "click to open", but I still experience the behaviour where sometimes, it doesn't collapse due to the fact that it's running in the iframe and the mouse is no longer hovering over the iframe.  I get this behaviour in all browsers, IE 7, 8, 9, FF, Chrome, Safari.

I hope this makes sense and I was hoping that there's a timeout script or something that I can place on the page with the radmenu running inside the iframe that will collapse all child menu's say after a second or two, if the mouse is no longer over it?

Any advice would be appreciated!

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 27 Jun 2012, 10:33 AM
Hello David,

The setTimeout() function enables you close the RadMenu control depending on the time you specify in the function's argument. For instance with the below code the menu will close after 3 seconds:
<script type="text/javascript">
       function OnClientItemOpened(sender, args) {
           setTimeout(" var menu = $find('menu1'); menu.close(true);", 3000);
       }
        </script>

markup used:
<telerik:RadMenu runat="server" ID="menu1" OnClientItemOpened="OnClientItemOpened">
           <Items>
               <telerik:RadMenuItem Text="item1">
           ....
</telerik:RadMenu>


All the best,
Kate
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Menu
Asked by
David
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or