options = $.extend({ ... }, options) is a popular construct in
plugins.
It allows to define default values for a options hash that is passed
as the only parameter.
On Jun 5, 4:22 am, runrunforest craigco...@gmail.com wrote:
thank you, I don't see that in other plugin, acutually so far i've not
That's called ternary syntax:
(expression) ? True : false;
If the expression evaluates to true, then the true portion is run, else the
false portion is run. A real world example:
Var total = (myValue == 15) ? 15 * 3 : myValue / 2;
Not helpful, but that's how it's used.
As for the other
The commas are just allowing multiple values to be set in one single
line, ie/
var running = false, animCss=o.vertical?top:left
is the same as
var running = false;
var animCss=o.vertical?top:left;
if you don't understand conditional if statements, an example is that
the value of animCss is
thanks man
how about $(ul, div)
Of runrunforest
Sent: Thursday, June 04, 2009 10:54 AM
To: jQuery (English)
Subject: [jQuery] Re: can someone translate this syntax ?
thanks man
how about $(ul, div)
thank you so much
ah one more thing
in o = $.extend({ afterEnd: null }, o || {});
the o || {} means ?
if the value is null, it will assign it as an empty object
On Jun 4, 12:47 pm, runrunforest craigco...@gmail.com wrote:
ah one more thing
in o = $.extend({ afterEnd: null }, o || {});
the o || {} means ?
(English)
Subject: [jQuery] Re: can someone translate this syntax ?
ah one more thing
in o = $.extend({ afterEnd: null }, o || {});
the o || {} means ?
thank you, I don't see that in other plugin, acutually so far i've not
yet see the same plugin structure.
10 matches
Mail list logo