Change animation direction with variable in jQuery
===

I searched this topics and i find some responses but they didnt seem to work for my code. Part of my code is this:

    var direction = "left";
    
    $("#lr-s ul#"+number).animate({"left": "-="+widthvar}, speedvar, "linear", function() {
            $("#lr-s ul#"+number).clone().attr('id', number+1).css(direction, (0+container_w)).appendTo("#lr-s");
    });

In css the variable direction work ok, but when i do this:

    $("#lr-s ul#"+number).animate({direction: "-="+widthvar}, speedvar, "linear", function() {

Putting the "direction" variable dosnt seem to work. I need that the direction changes ("left, "right", "bottom", "top") so changing the symbol -= for += dosnt fit for me. I also tried:

    var settings = {};
    settings[direction] = scrollAmount;
    $("#lr-s ul#"+number).animate(settings, speedvar, "linear", function() {

and

    var settings = {"left": "-="+widthvar};
    $("#lr-s ul#"+number).animate(settings, speedvar, "linear", function() {

Nothing worked. Help please. Thanks.
