Ok I have a dynamic menu which consists of dynamically generated images. Since these images are generated dynamically there are no heights and widths associated with them.
The menu has two levels and I would like the child group to be displayed starting beneath the first item of the menu, not directly below its parent! The reason is that the child group will actually span too long if it's directly below its parent item.
I want it like this:
| PARENT 1 | PARENT 2 |
| CHILD 1 | CHILD 2 | CHILD 3 |
The following JavaScript works if I don't use Images, only text, but unfortunately it doesn't work with images!
Can anyone help me please
The menu has two levels and I would like the child group to be displayed starting beneath the first item of the menu, not directly below its parent! The reason is that the child group will actually span too long if it's directly below its parent item.
I want it like this:
| PARENT 1 | PARENT 2 |
| CHILD 1 | CHILD 2 | CHILD 3 |
The following JavaScript works if I don't use Images, only text, but unfortunately it doesn't work with images!
Can anyone help me please
| function OnClientLoad(sender, args) { |
| var counter = 0; |
| var width = 0; |
| menu = sender; |
| var temp = 0; |
| for (var i = 0; i < menu.get_allItems().length; i++) { |
| width = 0; |
| var item = menu.get_allItems()[i]; |
| if (item.get_level() == 1) { |
| var parent1 = item.get_parent(); |
| var parent2 = parent1.get_parent(); |
| var items = parent2.get_items(); |
| for (var j = 0; items.getItem(j).get_text() != parent1.get_text(); j++) { |
| widthwidth = width + items.getItem(j)._getWidth(); |
| } |
| parent1.get_groupSettings().set_offsetX(0 - width); |
| } |
| } |
| } |