Bug Tracker

Modify

Ticket #3444 (closed enhancement: duplicate)

Opened 5 years ago

Last modified 5 years ago

Allow speed of 0 in animate to be instant

Reported by: jonahfox Owned by: flesler
Priority: minor Milestone: 1.3
Component: effects Version: 1.2.6
Keywords: css animate Cc:
Blocking: Blocked by:

Description

It would be really useful if $.fn.animate understood speed of 0 as being instant (rather than null => default speed)

I currently use the following to achieve this :

$.fn.animate2 = function(css, speed, fn) {

if(speed === 0) {

this.css(css) fn()

} else {

this.animate(css, speed, fn)

}

}

It is also in the best interest of accessibility to enable a way to disable all animations across the board, so putting this somewhere in core animation functions to recognize a 0 speed animation as synonym for .css would help in those efforts, should they exist.

see discussion here

 http://groups.google.co.uk/group/jquery-dev/browse_thread/thread/524f3e1c22d730f7/921fcf2efd3798c3#921fcf2efd3798c3

Change History

comment:1 Changed 5 years ago by flesler

  • need changed from Review to Patch
  • Status changed from new to assigned
  • Component changed from unfilled to fx

comment:2 Changed 5 years ago by flesler

  • Status changed from assigned to closed
  • Resolution set to duplicate

Oops.. I made a search inside Trac and couldn't find this ticket, so I created a new one.

Duplicate of #3495.

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.