gr3eNs0ul
gr3eNs0ul

Reputation: 11

Specific problem developing my jquery menu

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 :)

Upvotes: 0

Views: 82

Answers (3)

Adrian Schmidt
Adrian Schmidt

Reputation: 1885

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

Upvotes: 1

Turbotoast
Turbotoast

Reputation: 139

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?

Upvotes: 0

Nalum
Nalum

Reputation: 4213

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

Upvotes: 0

Related Questions