On 08/12/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Brandon Aaron schrieb:
> > On 12/8/06, Sam Collett <[EMAIL PROTECTED]> wrote:
> >> It has been updated to use the dimensions plugin (I am hesitant to use
> >> it as it is still in development, and the only way to get it is
> >> through svn). However, the positioning is still not right.
> >
> > The plugin resides in SVN with the other plugins and is ready for
> > production use. There seems to be some misconceptions about the
> > dimensions plugin.
> >
> >> Think of it as a test case for the dimensions plugin. If it worked as
> >> intended, I should not have to worry about padding, margins,
> >> scrollbars etc - left, top, height should take those into account.
> >
> > Indeed and we need more people to use it and test it. :)
>
> Brandon,
>
> I wanted to use it for Plazes, but then experienced that it was quite
> slow. I wanted to use offset() to create kind of a tooltip that follows
> the mouse cursor on mouseover. It seems to me that there is too much
> going on if I need just one value (the offset from the element in its
> parent container). I ended up in extracting the parts I needed.
>
> I also hesitated, because the plugin overwrites height()/width() and I
> don't know in which way.
>
> Still its a great plugin, don't get me wrong!
>
>
> -- Klaus

Perhaps it just needs a bit of minor refactoring?

Still keep offset, but simplify it to use other plugins (that you
could use separately if you only wanted the left position of an
element for instance):

jQuery.fn.offset = function(refElem) {
    var elem = this[0];
    return {
        left: this.realLeft() - jQuery(refElem).realLeft(),
        top: this.realTop() - jQuery(refElem).realTop(),
....etc
    }
}

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to