📄 anatomy.html
字号:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>dhtml menu javascript menu</title> <link rel="stylesheet" href="../code.css" /> </head> <body onload="window.parent.sectionLoaded(document.body)"><div style="font-size: 1px; line-height: 1px"><br /></div> <h1>The anatomy of a menu</h1> <p> As you can see, the menu is a list (<tt>ul</tt>). This list has items (<tt>li</tt>); these items translate to menu items. Each item can optionally contain a list which if present will be translated to the item's submenu. </p> <p> As intuition tells you, the top-level list will be displayed as a horizontal menu bar. Level-one nested lists will be the first level of popup menus, etc. </p> <h2>Menu items</h2> <p> Each menu item is described by a <tt>li</tt> (a list item) element. In the menu, it will belong to the (sub)menu defined by the parent list. </p> <p> A <tt>li</tt> that only opens a submenu can contain text (menu label), an optional icon (which is an usual <tt>img</tt> element) and a nested list. A <tt>li</tt> which has an associated action needs to contain an <tt>a</tt> (link) element. The action of a menu item can be either to trigger the execution of some JavaScript code, or to open some URL. </p> <p> If the action is to execute JavaScript code, then the link's <tt>href</tt> argument will be in the form "javascript:doAction()" where <tt>doAction</tt> is your custom defined function. If the action is to open an URL, the <tt>href</tt> is the URL, as usual, and the link can optionally include a <tt>target</tt> attribute which specifies in which frame to open the URL (for example "_blank" will cause the link to open in a new window). </p> <p> Menu items can display a help string in the window status bar. This help string is passed as the "title" argument to either the <tt>li</tt> element or to the <tt>a</tt> element. </p> <p> If present, the link element takes precedence over the <tt>li</tt> element when deciding what label and help string to assign to the menu item. </p> <h2>Menu item examples</h2> <p> Being the very simplest form of a menu 鈥渋tem鈥
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -