|
Giving absolute positioned items an auto width
I made a simple drop down menu, eg mouse over an item and a list of items drops down from it.
I wrote some Javascript (jQuery) that gives the item that drops down (a ul) a min-width equal to the link it comes from. The problem I'm having is that the dropdown's content is auto generated, can be multiword, and is often longer then the width of the parent. Because its absolutely positioned, it doesn't get wider though; it sticks to the min width. So I have some items that are going multi-line and it looks weird.
I'm wondering if anyone knows how to get an absolutely positioned item to get an auto width (if this makes sense), or knows a Javascript trick I could use to do it?
|