See https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/618-getoffsetparent-returns-body-for-new-hidden-elements-in-ie8-final
I've posted an HTML example there that shows the difference between shown and hidden elements. I'm not sure what the real solution is to this. -- Rod On Mar 25, 7:34 pm, ced <catcal...@gmail.com> wrote: > yes, target is hidden: > I'm using Autocompleter.selectbox (a scriptaculus > plugin)http://www.glanzani.com.ar/select/ > I had to change Autocompleter behaviur to solve this issue, but I > preferred to solve the problem where it happens (as it's wrong how it > is calculated in ie8 the delta, not the fact that the target is > hidden) > > could you test that if target isn't hidden my solution fails? > If it's so I think it would be needed to change the if inserting > target display hidden as a condition > > ced > > On 24 Mar, 22:26, Rod <r...@vagg.org> wrote: > > > Is your target element visible? I hit this same problem with IE8 in > > our app for elements that were created with display:none;, IE8 seems > > to think they don't have the right offsetParent. To fix, I simply made > > them visible before calling clonePosition and the parent delta was > > included correctly in the positioning. > > > Have been meaning to put something in Lighthouse about this when I > > have time, I couldn't see anything that already addresses this > > problem. I'm not sure what the cleanest solution is because if the > > element is visible then it appears to behaves correctly. > > > -- Rod > > > On Mar 25, 2:08 am, ced <catcal...@gmail.com> wrote: > > > > I had a problem cloning position with prototype 1.4 and 1.6 in ie8 > > > don't know exactly why it behaves like this.. but that's my solution: > > > hope it could be useful: > > > > In 1.4 I changed this > > > > if (Element.getStyle(target,'position') == 'absolute') { > > > parent = Position.offsetParent(target); > > > delta = Position.page(parent); > > > > } > > > > with this: > > > > if (Element.getStyle(target,'position') == 'absolute') { > > > parent = Position.offsetParent(target); > > > delta = (navigator.appVersion.indexOf('MSIE 8')>0)?Position.page > > > (source):Position.page(parent); > > > > } > > > > if (navigator.appVersion.indexOf('MSIE 8')>0){ > > > delta[0]-=source.offsetLeft; > > > delta[1]-=source.offsetTop; > > > > } > > > > the solution is identical for 1.6 but instead of Position.page(parent) > > > I used page.viewportOffset() as it was --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---