I've extended a form control that creates and embeds some elements in
the form.  It then positions those elements based on the location and
size of the text field that is being adjusted.  Everything works great
when the control is created on the main web page.

My problem is that if I load the form using AJAX, the browser is
figuring out the dimensions and placement of everything while my
script is being evaluated.  As a result the relative positioning is
way off.  I need a way to either delay the positioning until the
browser is done drawing the AJAX loaded form, or some other way of
ensuring the positioning is correct.

The error behaves the same way in Firefox 3.5, Chrome 2, and Safari
4.  The positioning is off the same amount in all of these browsers.
The good news is that it is predictable, the bad news is that the
positioning behaves differently whether you use AJAX or the page is
loaded normally.

My positioning code is here:

        // Position the image buttons and make room for them in the
textField
        var height = this.textField.getHeight();
        var width = this.textField.getWidth();

        this.textField.setStyle({width: (width + 10) + 'px'});

        Element.clonePosition(this.upControl.identify(),
this.textField.identify(),
            {setWidth: false, setHeight: false, offsetTop: 2,
offsetLeft: width + 2});
        Element.clonePosition(this.downControl.identify(),
this.textField.identify(),
            {setWidth: false, setHeight: false, offsetTop: height -
10, offsetLeft: width + 2});

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to