spacer

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

home / experts / dhtml / column35
Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags

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

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