Bug Tracker


Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#7755 closed bug (invalid)

animate with background-position and negative top position does not work

Reported by: anonymous Owned by: anonymous
Priority: low Milestone: 1.next
Component: effects Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


If you try to animate a background-image by background-position and the initial-Y-position of the background is negative, then the animate-command will start at zero instead at the y position.

image.css({'background-position': '200px -200px'});
image.animate({'background-position': '0px 0px'}, 5000);

As you can see in this example the background will be first set to 200px -200px and then when the animation begins it jumps to 200px 0px and animates to 0px 0px.

Change History (10)

comment:1 Changed 6 years ago by jitter

  • Owner set to anonymous
  • Status changed from new to pending

You might want to checkout the jQuery-cssHooks plugin (bgpos.js) which uses the new cssHooks functionality to animate background-position correctly. The documentation of css() and animate() clearly state that at the moment only properties which are

a single numeric value

are supported.

If the plugin works out for you might also try to do this yourself using the animate() step callback. Please report back if this suggestion work out for you.

comment:2 Changed 6 years ago by trac-o-bot

  • Resolution set to invalid
  • Status changed from pending to closed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:3 Changed 6 years ago by jitter

#7951 is a duplicate of this ticket.

comment:4 Changed 6 years ago by jitter

  • Component changed from unfiled to effects
  • Milestone changed from 1.6 to 1.next
  • Priority changed from undecided to low

comment:5 Changed 6 years ago by jitter

#8160 is a duplicate of this ticket.

comment:6 Changed 6 years ago by jitter

#7174 is a duplicate of this ticket.

comment:7 Changed 6 years ago by zachstronaut

If the main jQuery animate() function cannot support all standard cross-browser CSS properties, and we have to install hooks piecemeal to support those other properties, why have animate() be a part of core jQuery at all?

I move for jQuery animate() to support multiple value CSS properties by default or for animate() to be extracted from jQuery core.

comment:8 Changed 5 years ago by timmywil

#10802 is a duplicate of this ticket.

comment:9 Changed 5 years ago by mikesherov

#11088 is a duplicate of this ticket.

comment:10 Changed 5 years ago by timmywil

#11270 is a duplicate of this ticket.

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

Modify Ticket

Change Properties

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

Note: See TracTickets for help on using tickets.