Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#7327 closed enhancement (wontfix)

jQuery animate passes fixed firstNum, diff to easing function

Reported by: tomalec Owned by:
Priority: low Milestone: 1.7
Component: effects Version: 1.4.3
Keywords: easing, firstnum, 1.7-discuss Cc:
Blocked by: Blocking:

Description (last modified by jzaefferer)

jQuery.animete uses easing function with firstNum, diff always set to 0,1:

this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);

So these parameters are completely useless for easing functions; for example:

swing: function( p, n, firstNum, diff ) {
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;

Could be changed to:

swing: function( p, n ) {
			return ((-Math.cos(p*Math.PI)/2) + 0.5);

I suggest changing it to:

this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, this.start, this.end - this.start , this.options.duration);
this.now = this.pos;

Change History (13)

comment:1 Changed 10 years ago by SlexAxton

Component: unfiledeffects
Keywords: easing firstnum added
Priority: undecidedlow
Status: newopen
Type: bugenhancement

comment:2 Changed 10 years ago by john

Milestone: 1.next

Let's look at this for 1.7.

comment:3 Changed 10 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:4 Changed 10 years ago by Rick Waldron

Description: modified (diff)


comment:5 Changed 10 years ago by jaubourg

-1, This will break plugins defining their own easing methods since it changes the scale of the arguments if I understand correctly

comment:6 Changed 10 years ago by timmywil

-1, customizing swing is valid

comment:7 Changed 10 years ago by john

+0, So yeah, it's not terribly useful in its current state - but making this change will break API, which is... quite bad.

comment:8 Changed 10 years ago by scottgonzalez

-1, this is like fixing .each(), it'd be a better API, but break all existing code

comment:9 Changed 10 years ago by addyosmani


comment:10 Changed 10 years ago by ajpiano

Description: modified (diff)

-1, Seems like an unwise thing to break

comment:11 in reply to:  7 Changed 10 years ago by tomalec

Replying to john: Break API? In my opinion it will fix the API, since real first number and difference can be different that 0 and 1. But for sure it can break things that uses this variables and assumes that they are static 0, 1 (which is also quite bad)

Replying to ajpiano: So maybe make firstNum and diff represent first number and difference, not the 0, and 1?

comment:12 Changed 10 years ago by jzaefferer

Description: modified (diff)


comment:13 Changed 10 years ago by Rick Waldron

Milestone: 1.next1.7
Resolution: wontfix
Status: openclosed

Closing per 1.7 roadmap meeting resolution

Note: See TracTickets for help on using tickets.