from controls.js:
if(!update.style.position ||
update.style.position==''absolute'') {
update.style.position = ''absolute'';
var offsets = Position.cumulativeOffset(element);
update.style.left = offsets[0] + ''px'';
update.style.top = (offsets[1] + element.offsetHeight) +
''px'';
update.style.width = element.offsetWidth + ''px'';
}
So, if you have no CSS position set (in the style attribute, not an
external stylesheet) or it''s set to "absolute" it will
try to position the div the left/bottom coordinates of the input and
give it the same width as the input element.
If you want to change that behaviour, you''ll have to override this
directly in the js code.
I''ll put this on the todo list, to make it possible to completely
switch off the automatich positioning here.
Thomas
Am 28.07.2005 um 12:43 schrieb Tench:
> hi.
>
> I''m rewriting the code from my own save-yourself-if-you-can
> implementation of xmlhttprequest to scriptaculous autocompleter,
> and it''s all fine and dandy, except that I am having difficulty
> positioning the auto_complete div which contains the results
> returned by xmlhttprequest.
>
> the auto_complete div is always stuck in one place, it starts a
> little below and half way to the right of the input form. i swear
> to god, no matter what kind of css styling i apply to it, it has no
> effect. (i can apply different background colors etc, those get
> displayed, but positioning doesn''t do a thing).
>
> i looked at the dom, and surely, my css styled rules are listed
> there, but also some absolute positioning that''s clearly coming
> from the js code...
>
> am i missing something totally obvious? i want to take back my
> divs!!! please let me know if you have any suggestions.
>
> all best,
> tench
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>