-
23 Feb 2007 2:37 AM #1
Alpha 1.0 - Menu with image (not toolbar)
Alpha 1.0 - Menu with image (not toolbar)
I am using Alpha 1.0 menu API to build the menu which is similar to yahoo menu YUI example, http://developer.yahoo.com/yui/examp...pwithanim.html
I checked the example coming with the alpha package and it has only toolbar example. My requirement is the initial parent menu is an image and mouse over that image will render the child menu. Please help me achieve this.
Thanks,
Thameem
-
23 Feb 2007 3:21 AM #2
this should do it:
Having this image tag:Code:var menu = new Ext.menu.Menu({shadow: false}); menu.add( {id:"opt1", text: 'option1'}, {id:"opt2", text: 'option2'} ); Ext.get('test').on('mouseover', function() { menu.show(Ext.get('test'), "tl-bl") });
Code:[img]/path/to/image.gif[/img]
-
23 Feb 2007 3:35 AM #3
Thanks for the suggestion. But I don't think this is the clear way to do it. Because when I mouse over the image it pops up the menu. But when I mouse out the menu stays there. If I add event handler for 'mouse out' its not even popping up the menu. And moreover the menu is appearing below the image. So, there might be a good way of doing this.
Jack, You can shed some light on this.
Thanks,
Thameem
-
23 Feb 2007 4:21 AM #4
The menu follows the windows-logic. When a menu is activated you can only deactivate it by clicking outside the menu.
The problem with the mouseout event is that you will trigger it as soon as you leave the image (and enter the menu).
-
23 Feb 2007 4:27 AM #5
The default logic as mnugter said is to hide on mousedown somewhere. If you need other logic it is definitely possible but you would have to add it. I can help, if you have questions.
Also, the second param 'tl-bl?' is an alignTo alignment option. Take a look at Ext.Element.alignTo which has great documentation on the format for these alignment options.
Similar Threads
-
Using the Toolbar as a menu
By Animal in forum Ext 1.x: User Extensions and PluginsReplies: 132Last Post: 23 Oct 2008, 4:38 AM -
toolbar menu on basic dialog or LayoutDialog
By reang in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 21 Mar 2007, 11:27 PM -
Menu/Toolbar basic concepts
By fecund in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 6 Mar 2007, 12:21 PM -
IE6 FF difference in toolbar menu
By vtswingkid in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 22 Feb 2007, 8:44 AM -
Problem with Toolbar background Image
By nnance in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 16 Feb 2007, 9:36 PM


Reply With Quote