views:

114

answers:

1

I have content arranged thusly:

<div id="thumbnails" style="width: 40px; overflow: auto;">
  <div style="float:left; width: 20px;">content</div>
  <div style="float:left; width: 20px;">content</div>
  <div style="float:left; width: 20px;">content</div>
  <div style="float:left; width: 20px;">content</div>
  <div style="float:left; width: 20px;">content</div>
  <div style="float:left; width: 20px;">content</div>

In IE7 this shows up with the content running out of the scrollable box. The answer everywhere is to make #thumbnails position:relative. My problem is that the items in #thumbnails are scriptaculous draggables that drag outside of thumbnails with a ghost of the element that is positioned absolutely. This does not go over well if the parent is positioned:relatively because now the absolute positions are relative to #thumbnails and not the <body>. Does anyone know an alternative solution to the IE7 bug?

A: 

Have you heard about this annoying IE "hasLayout" property? http://msdn.microsoft.com/en-us/library/bb250481(VS.85).aspx (quoting some msdn hurts, I feel dirty now...). Anyway, try to apply "zoom: 1" to you container: it might improve the situation. Only issue: zoom property is IE only and will create a warning in your css logs under another browser.

Zaziffic
Yeah, I did find that. It wasn't a hasLayout problem. I ended up creating a new event in scriptaculous that fires before initializing a draggable. I handle that event, position "thumbnails" relative and set visibility: hidden to all of "thumbnails" children. Then onDragEnd, set everything back to visible and relative. Thanks for the suggestion though.
Myles