On Tuesday 13 November 2007 12:54, Matt Kruse wrote:
> On Nov 12, 5:45 pm, Peter E Higgins <[EMAIL PROTECTED]> wrote:
> > On Tuesday 13 November 2007 11:26, XASD wrote:
> > > function in place of value for property dosen't work.
>
> Is it expected to?

probably not. 

> > try using a closure?
> > $('#foo').css("borderTop",(function(){ return "5px";  })());
>
> First, that's not a closure, it's just an immediate execution of an
> anonymous function (which can also be used to create a closure).

my bad.

> Second, I can't think of any reason to do that over just using "5px"
> as the value :)

I am sure there a million shorthand jQuery ways to do it, but getting the 
value from the anon function (or any other function) seems a very common use 
case. that example, no- borderTop isn't very vital.  but to set something's 
top or left position based on the viewport height with some extra 
calculations because you happen to need to, it seems kind of useful. 

> Matt Kruse

Reply via email to