No, you are correct that you could do this without the dimensions
plugin. The reason it didn't work was because you where passing a
function and Jörn's patch addressed that scenario.

--
Brandon Aaron

On 2/13/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Jörn Zaefferer schrieb:
> > Klaus Hartl schrieb:
> >> Stupid me, I forgot a return statement (too much Ruby lately)... and
> >> also the unit seems to be required:
> >>
> >> $('div.image p').css('width', function() {
> >>      return $(this).prev().width() + 'px';
> >> });
> >>
> > jQuery.prop could be modified to append the "px" to computed values like
> > in the above example. This should do it:
> >
> > Index: I:/dev/workspace/jquery/src/jquery/jquery.js
> > ===================================================================
> > --- I:/dev/workspace/jquery/src/jquery/jquery.js      (revision 1327)
> > +++ I:/dev/workspace/jquery/src/jquery/jquery.js      (working copy)
> > @@ -1280,7 +1280,7 @@
> >       prop: function(elem, value, type, index, prop){
> >                       // Handle executable functions
> >                       if ( jQuery.isFunction( value ) )
> > -                             return value.call( elem, [index] );
> > +                             value = value.call( elem, [index] );
> >
> >                       // exclude the following css properties to add px
> >                       var exclude = 
> > /z-?index|font-?weight|opacity|zoom|line-?height/i;
> >
> >                       // Handle passing in a number to a CSS property
> >                       return value && value.constructor == Number && type 
> > == "curCSS" && !exclude.test(prop) ?
> >                               value + "px" :
> >                               value;
> >       },
> >
> > Is there anyway where that could break?
> >
>
> I actually thought jQuery was already doing this, that's why I was
> surprised. But now I think I confused that with the dimensions plugin.
>
> Sounds reasonable to me.
>
>
>
> -- Klaus
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>

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

Reply via email to