Hi.

I know, strange topic description. But i didn't know how to describe it a better way.

Example (works):

var uToggle = {
        speed: 'fast'
        ...

        xxx: function(e) {
                $(e).parent().next().fadeIn(uToggle.speed);
        }
};

Example (doesn't works):

var uToggle = {
        animationType: 'fadeIn',
        speed: 'fast'
        ...

        xxx: function(e) {
                $(e).parent().next().uToggle.animationType()(uToggle.speed);
        }
};

I guess its a simple syntax matter: How must i declare the animationType default/option value in the chain? Only using the Speed default (like in the first example) works as the fadeIn/Out() expects a string for the speed value. But if i want to define a option for e.g. the animation type itself, i fail to define it correctly in the chain.
Could anyone get me a hint how to do it? Thanks.


greets
Olaf




Reply via email to