Bug Tracker

Modify

Ticket #7327 (open enhancement)

Opened 3 months ago

Last modified 3 months ago

jQuery animate passes fixed firstNum, diff to easing function

Reported by: tomalec Owned by:
Priority: low Milestone: 1.5
Component: effects Version: 1.4.3
Keywords: easing firstnum Cc:
Blocking: Blocked by:

Description

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

comment:1 Changed 3 months ago by SlexAxton

  • Keywords easing firstnum added
  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to effects
  • Type changed from bug to enhancement

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

View

Add a comment

Modify Ticket

Action
as open
Author


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

 
Note: See TracTickets for help on using tickets.