On 31/07/2007, at 2:10 AM, Joel Birch wrote:
var leftAlign = true;
var posiOffset = 10;
var c = { width : 100px};
c[leftAlign ? 'left' : 'right' ] = posiOffset +'px';
$('#el').css(c);

Correction: obviously 100px needs to be in quotes, and the first two variables are actually set dynamically, not hardcoded as shown. Sorry, its late here.

Joel.

Reply via email to