Alex, I think you're right. But I thought an element had to be absolutely positioned for clonePosition to work properly. In fact, I tried to turn span #2 into a relative element and the positioning was not even close. You said span #2 inherits the style, but the parent element, in my case, is just the body of the document. Should I place another span around the two spans? I'm not sure I follow you.
Thanks! Tiago On Sep 3, 7:41 am, "Alex McAuley" <[email protected]> wrote: > Its to do with the absolute positioning of Span 2 as it inherits the > style... > Alex Mcauleyhttp://www.thevacancymarket.com > > ----- Original Message ----- > From: "Tiago" <[email protected]> > To: "Prototype & script.aculo.us" <[email protected]> > Sent: Thursday, September 03, 2009 3:24 AM > Subject: [Proto-Scripty] clonePosition not behaving accurately on spans > > > Hello, > > > I wrote the following HTML code: > > > <span id="1"> > > <input type="text" value="Some text" /> > > </span> > > > <span id="2" style="position: absolute"> > > <input type="text" value="Some text" /> > > </span> > > > And I would like to place span #2 on the same position as span #1. I > > tried to run the following command: > > > $('2').clonePosition($('1')); > > > However, span #2 is placed a little below span #1 (2 pixels or so). > > Does anyone know why this happens? Is there anyway to correct this? > > > It's worth noticing that the method clonePosition works accurately if > > I replace the spans by divs (or any other block element). > > > Thanks a lot, > > Tiago --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
