Sample 6: What's Next ?

You might have already seen the "Menu for Map" and "Pop-Up Menu" in my "Menu Kit", they look pretty the same in G2, except you can open them in different directions. So I don't feel the need to build samples for them.

There is one more thing to mention about the "Menu for Map". "Menu for Map" should actually be named "Menu for Links", though it was designed initially for maps. All it does is to open a menu at where you click on a link-able html element.

What else can we do with G2 then?

Well, let's take a look at the menu in the left frame. Just move your mouse over the menu and try clicking on it.

Surprised? Though G2 is not designed to build menus like that, it does provide two more functions for menu manipulations:

There are 8 menus in this sample. "Menu A", "Menu B", "Menu C", "Menu D" and their submenus(not really submenus, just associated to them) are all individual menus, and set to visible initially. The submenus are placed right under their parent menus, but with the x-coordinate set to (-150), that's why you can't see them at the very beginning.

The sample has some "add-on" js codes which retrieve the height of each menu, and use the "moveMenuBy()" function to move the menus correspondingly when you click on the top level menu, makes it look like you are opening or closing a submenu.

Sounds interesting? If you have some creative ideas on menus in mind, let me know and I'll see whether I can build them for you with G2.