How do you passing parameters via the settings?

An example is passing the speed

   var settings = {
         ...
         show: "slideDown(50)",
         ...
    };

I get a syntax error for:

   $box[ settings.show || 'show' ]();

I guess I have to passing the parameter as setting?

   var settings = {
         ...
         show: "slideDown".
         speed: 50,
         ...
    };

   $box[ settings.show || 'show' ](settings.speed);

Correct?

--
HLS




On Oct 9, 1:49 am, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> > From: Pops
> >      var how = (settings.show!="")?settings.show:"show";
> >      eval("$box."+how+"()");
>
> foo.bar means the same thing as foo['bar'], so this code is the same as:
>
>   var how = (settings.show!="")?settings.show:"show";
>   $box[how]();
>
> Or a very clean and simple version:
>
>   $box[ settings.show || 'show' ]();
>
> -Mike

Reply via email to