• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Menus

You can even put together a menu system displayed inside a web page using styles. To do that, you need a browser that supports the visibility style property (although it’s possible to make menus “appear” and “disappear” with their left and top properties, moving them on- or off-screen).

Here’s a demo menu program, targeted at IE5+. (Earlier versions didn’t support the CSS2 visibility property.) Here the menu is actually a <DIV> that encloses a <TABLE> element (which I use to make sure the menu items appear one on top of the other). When the user clicks the menu name (File), the menu opens by making the <DIV> containing the menu visible. (And if the user clicks outside the menu without making a selection, the menu will close.) Each item in the menu is actually a hyperlink (with its TEXT-DECORATION style attribute set to none to remove underlining) to a JavaScript URL, enabling you to place code to execute when the user clicks that menu item in a JavaScript function.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint