Bug Tracker

Modify

Ticket #6191 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by snover

  • Milestone 1.4.3 deleted

Resetting milestone to future.

comment:2 Changed 3 years ago by dmethvin

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to invalid
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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.