spacer

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

home / experts / dhtml / column35
Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

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

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