Possible Duplicate:
Using a dynamic variable as object literal, jQuery animate function
I'm attempting to pass a function argument as a setting for a jquery animation except I cannot get it working.
The Function
function gridClick(a, b){
$(c).animate({
a : 0,
b : 0
}, 10000)
};
calling the function
gridClick('top', 'left', this);
console log shows that a and b are being put out as top and left but they are not actually affecting the animation as top and left. Is this a syntax error or is there more going on?