Bug Tracker

Opened 10 years ago

Closed 9 years ago

#6191 closed bug (invalid)

Assigining CSS property in animate() via external variable fails

Reported by: riddle Owned by:
Priority: undecided Milestone:
Component: effects Version: 1.4.2
Keywords: animate property Cc:
Blocked by: Blocking:

Description

var part = 'left'; for testing purposes only var margin_variable = 'margin-' + part;

this works: $element.stop().animate({

'margin-left': '-100px', 'opacity': '1.0'

}, 100);

this won't work: $element.stop().animate({

margin_variable: '-100px', 'opacity': '1.0'

}, 100);

Change History (2)

comment:1 Changed 9 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:2 Changed 9 years ago by dmethvin

Priority: undecided
Resolution: invalid
Status: newclosed
var args = { opacity: '1.0' };
args['margin-'+part] = '-100px';
$element.stop().animate(args, 100);

Ask for help on the forum if you need to learn more.

Note: See TracTickets for help on using tickets.