You don't need to use a function for that, just do:

$("#element").width( $("body").width() );

as $("body").width() returns a value that is used by $("#element").width(
... ). If you still have problems, debug it with
Firebug's<http://getfirebug.com>console part by part and check if you
are getting strings from those
functions when you need integers and things like that.

Abel.

On 3/17/07, [ForaysForYou] Commissary <[EMAIL PROTECTED]> wrote:

hello all,

I'm very new to JQuery and I'm struggling, I've gone through the
documentation and I'm still clueless. I am trying to do the following:

Each time the browser window gets resized I want to measure the width of
the body and use that value to set the width of an element. Here is my
best attempt (I know this is wrong):

$("#element").width(function() { $("body").width(); } );

Should I be using variables to store the value? I think I need to use a
callback but I can't figure it out.

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

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

Reply via email to