473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get UL coordinates and size?

Hello.

I have several nested undordered lists like this:

<ul id="menu">
<li>1. First item</li>
<li>2. Second item
<ul>
<li>2.1. Sub item</li>
</ul>
</li>
<li>3. Third item</li>
</ul>

With that structure and CSS and some javascript you can make a drop-down
menu. See for example http://www.alistapart.com/articles/horizdropdowns/

I have a problem with these menus and windowed controls (like a list
box) in MSIExplorer. The list box is always over the drop-down menu.

I have seen a method to put the drop down menu over the list box. You
can read it here:
http://dotnetjunkies.com/WebLog/jkin...07/21/488.aspx

To cover the list box I have to shim an IFRAME under my root UL. To do
that I need to get the UL coordinates and its width and height.

How can I do that?

I have tried this:
ul=document.getElementById('menu');
ifrWidth=ul.offsetWidth;
ifrHeight=ul.offsetHeight;
ifrTop=ul.style.top;
ifrLeft=ulstyle.left;

but it doesn't work. The ul's width and height doesn't include the
nested lists and the top and left propoerties are 0.

I have uploaded an example to this URL:
http://www.tel.uva.es/~jpozdom/cssmenu/cssmenu.html

Bye and thanks in advance.
Jul 23 '05 #1
1 2590
Jesús Ángel wrote:
[...]
To cover the list box I have to shim an IFRAME under my root UL. To do
that I need to get the UL coordinates and its width and height.

How can I do that?

[...]

Have a read here:

<URL:http://www.quirksmode.org/js/findpos.html>

--
Fred
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Suresh Kumar | last post by:
Hi, In Tkinter, how to convert canvas coordinates to window coordinates? To convert window coordinates to canvas coordinates we are using "canvasx,canvasy". But how to do vice-versa? Iam using a...
3
by: Berk Birand | last post by:
Hi, I am new to Perl (as a matter of fact, I started learning it a couple of days ago; I have some previous programming experience though). When looking for the ideal languages to use for a...
1
by: phil cunningham | last post by:
I am new to C# and GDI+ so I may have missed a simple way of doing this. I am trying to use the mouse to pick object up by seeing if the mouse position is Inside the object. However, I am using...
0
by: deko | last post by:
I'm trying to implement a custom TreeView that shows a ghost image while dragging. But the form I'm using is different from the sample code found here:...
9
by: pcnerd | last post by:
I created a demo program with a status bar & status bar label on the form. When the program runs, it's maximized. When I move the mouse over the form, I can see the X & Y coordinates changing on...
3
by: Harch84 | last post by:
Hi I am using a javascript for google maps to geocode two locations and I thin want to retrieve the two coordinates and enter them into a Perl Script. Now I have managed to set up the page with the...
1
by: Cainnech | last post by:
Hi all, I've got a bit of a challenge. I've got a script which displays the mouse coodinates if you click on an image. Now I would like to convert these coordinates to pixelnumber. Let me see if I...
2
by: laredotornado | last post by:
Hi, I'm using php 4.4.4. Maybe I'm misreading the docs, but in the imagettfbbox manual (http://us2.php.net/imagettfbbox), it says that text coordinates are the same regardless of what the angle...
0
by: raylopez99 | last post by:
keywords: logical coordinates, page coordinates, world coordinates, device coordinates, physical coordinates, screen coordinates, client coordinates. offset rectangle. WYSIWYG rubber rectangle...
0
by: mingke | last post by:
Hi.... I'm having difficulties with my codes to list coordinates (in my example codes is 4x4 pixel). I tried two different codes and the results are different.Basically, I tried to declare the sub...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.