Figure 3-7: Now, only the next level of menu shows up on a mouse hover in Java
Figure 3-7: Now, only the next level of menu shows up on a mouse hover PDF 417 Printer In Java Using Barcode generation for Java Control to generate, create PDF 417 image in Java applications. Creating Dynamic Lists
Generating Bar Code In Java Using Barcode creation for Java Control to generate, create barcode image in Java applications. This trick allows you to create nested lists as deeply as you wish and to open any segment by hovering on its parent My current code has a list with three levels of nesting, but you can add as many nested lists as you want and use this code to make it act as a dynamic menu Figure 3-8 illustrates how to open the next section of the list I m not suggesting that this type of menu is a good idea Having stuff pop around like this is actually pretty distracting With a little more formatting, you can use these ideas to make a functional menu system I m just starting here so you can see the hide-and-seek behavior in a simpler system before adding more details Barcode Recognizer In Java Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications. Book III 3
Encode PDF 417 In C#.NET Using Barcode drawer for VS .NET Control to generate, create PDF 417 image in .NET applications. Styling Lists and Menus
PDF-417 2d Barcode Drawer In .NET Using Barcode maker for .NET Control to generate, create PDF417 image in Visual Studio .NET applications. Figure 3-8: You can create these lists as deep as you wish
PDF417 Encoder In Visual Basic .NET Using Barcode creation for .NET framework Control to generate, create PDF 417 image in Visual Studio .NET applications. Building a Basic Menu System
Encode EAN / UCC - 13 In Java Using Barcode creation for Java Control to generate, create EAN / UCC - 13 image in Java applications. Building a Basic Menu System
Making EAN / UCC - 14 In Java Using Barcode printer for Java Control to generate, create UCC-128 image in Java applications. You can combine the techniques of buttons and collapsing lists to build a menu system entirely with CSS Figure 3-9 shows a page with a vertically arranged menu When the user hovers over a part of the menu, the related sub-elements appear, as shown in Figure 3-10 This type of menu has a couple interesting advantages, such as It s written entirely with CSS You don t need any other code or programming language The menus are simply nested lists The XHTML is simply a set of nested lists If the CSS turns off, the page is displayed as a set of nested lists, and the links still function normally The relationships between elements are illustrated When you select an element, you can see its parent and sibling relationships easily Nice as this type of menu system is, it isn t perfect Because it relies on the li:hover trick, it doesn t work in versions of Internet Explorer (IE) prior to 70 Code 3/9 Encoder In Java Using Barcode printer for Java Control to generate, create USS Code 39 image in Java applications. Figure 3-9: Only the top-level elements are visible by default
Encode Bar Code In Java Using Barcode drawer for Java Control to generate, create barcode image in Java applications. Building a Basic Menu System
Data Matrix ECC200 Generation In Java Using Barcode drawer for Java Control to generate, create DataMatrix image in Java applications. Figure 3-10: The user can select any part of the original nested list
Delivery Point Barcode (DPBC) Maker In Java Using Barcode creation for Java Control to generate, create Delivery Point Barcode (DPBC) image in Java applications. Book III 3
Making Bar Code In C#.NET Using Barcode printer for .NET framework Control to generate, create bar code image in Visual Studio .NET applications. Building a vertical menu with CSS
Making Barcode In C#.NET Using Barcode drawer for Visual Studio .NET Control to generate, create barcode image in VS .NET applications. The vertical menu system works with exactly the same HTML as the hiddenList example only the CSS changed Here s the new CSS file: EAN13 Encoder In VB.NET Using Barcode maker for Visual Studio .NET Control to generate, create EAN13 image in .NET framework applications. /* horizMenucss */ /* unindent entire list */ #menu ul { margin-left: -25em; } /* set li as buttons */ #menu li { list-style-type: none; border: 1px black solid;; width: 10em; background-color: #cccccc; text-align: center; } /* display anchors as buttons */ #menu a { color: black; text-decoration: none; display: block; } /* flash white on anchor hover */ #menu a:hover { background-color: white; Code 39 Full ASCII Creator In VS .NET Using Barcode creation for .NET Control to generate, create Code 39 image in .NET framework applications. Styling Lists and Menus
Make EAN13 In C# Using Barcode creation for .NET framework Control to generate, create GS1 - 13 image in .NET framework applications. Building a Basic Menu System
Data Matrix ECC200 Drawer In .NET Using Barcode printer for Visual Studio .NET Control to generate, create DataMatrix image in .NET framework applications. } /* collapse menus */ #menu li ul { display: none; } /* show submenus on hover */ #menu li:hover > ul { display: block; margin-left: -2em; } Paint ECC200 In Visual C#.NET Using Barcode drawer for VS .NET Control to generate, create Data Matrix 2d barcode image in Visual Studio .NET applications. Of course, the CSS uses a few tricks, but there s really nothing new It s just a combination of techniques you already know: Bar Code Encoder In Visual Studio .NET Using Barcode printer for .NET Control to generate, create barcode image in .NET framework applications. 1 Un-indent the entire list by setting the ul s margin-left to a negative value to compensate for the typical indentation 25em is about the right amount Because you ll be removing the list-style types, the normal indentation of list items will become a problem 2 Format the li tags
Each li tag inside the menu structure should look something like a button Use CSS to accomplish this task: /* set li as buttons */ #menu li { list-style-type: none; border: 1px black solid;; width: 10em; background-color: #cccccc; text-align: center; } a Set list-style-type to none b Set a border with the border attribute c Center the text by setting text-align to center d Add a background color or image, or you ll get some strange border bleed-through later when the buttons overlap 3 Format the anchors as follows: /* display anchors as buttons */ #menu a { color: black; text-decoration: none; display: block; } a Take out the underline with text-decoration: none
Building a Basic Menu System
b Give the anchor a consistent color
c Set display to block (so the entire area will be clickable, not just the text) 4 Give some indication it s an anchor by changing the background
when the user hovers over the element: /* flash white on anchor hover */ #menu a:hover { background-color: white; } Because the anchors no longer look like anchors, you ll have to do something else to indicate there s something special about these elements When the user moves the mouse over any anchor tag in the menu div, that anchor s background color will switch to white
|
|
|
|
| ALL RIGHTS RESERVED. Business Refinery (c) 2006 - 2010. | Terms of Use | Privacy Policy |