views:

33

answers:

3

Hi guys, I am developing a menu using jquery.

The menu grows dynamically, and i need to keep the appearance for each level. And i do, but the problem is now the browsers. IE and Mozilla.

I am using jquery to get the width of unordered lists for when i pass with the mouse over the next level opens, in that width shifter to the right

http://img85.imageshack.us/i/menuip.png/

In firefox works ok because the width is not set to "none" but a integer value, but in IE is setted to "auto" and i need a integer value to shift to the right.

Suggestions?

thanks :)

A: 

Not sure if this is available in IE or not but you could try getting the offset width or the scroll width.

$(this).[0].offsetWidth/scrollWidth
Nalum
A: 

I'm not entirely sure, but I think the jQuery method width() should be able to compute the correct width of an element. Could you give us a code snippet describing how you get the element width?

Turbotoast
+1  A: 

jQuery UI has a Position method which is perfect for these things.

$("#position3").position({
  my: "right center",
  at: "right bottom",
  of: "#targetElement"
});

http://docs.jquery.com/UI/Position

Adrian Schmidt