spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / column35
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Logo

Hiermenus Go Forth, I:
Version 4 - The External Arrays



Elements 1 and 2 - left_position and top_position

Description
Set the absolute page pixel position of the top-level menu in a menu tree.

Value
Pixels
May be specified as:
Example Values
integers: 100,120
integers: ,120
integers: 100,

strings: "100","120"
strings: "","120"
strings: "100",""

JS expressions: "getLeft()","getTop()"
JS expressions: "(IE4) ? ((document.body.clientWidth<800) ? 50 : 100) : ((window.innerWidth<800) ? 50 : 100)",120

Default
There are no default values for these parameters. If omitted, the top-level menu will appear at the mouse position.

Differences from Version 3 equivalent
Version 3 accepted only integer values.

Comments
The use of JS expressions will probably be very popular for the setting of these position values. Many (very many) implementations of Version 3 included workarounds to introduce this feature.

For example, the menus are required to appear next to a list of vertical links in a table. Since we know the table's left position and the width of each link, we can simply include integer values for the parameters to place the menus.

However, what if the table was centered on the page. Its left position, and consequently the required menu absolute position, would be different for every browser window width!

You can create a function that finds the correct position each time the menu needs to be displayed. Then include the function call as a string in the array.


The next two parameter-elements set the font color for the menu tree.


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

All Rights Reserved. Legal Notices.
Created: Aug 08, 2000
Revised: Aug 08, 2000

URL: http://www.webreference.com/dhtml/column35/8.html