Modify ↓
Ticket #7327 (open enhancement)
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
Please use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
