Bug Tracker

Changeset 3299

Show
Ignore:
Timestamp:
09/15/07 02:40:42 (1 year ago)
Author:
jeresig
Message:

Convert relative animations to use -= and += (instead of just - and +, which conflicted with normal absolute animations). (Fixes bug #1607) Also fixed a bug in queue.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/fx.js

    r3290 r3299  
    9797                    e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); 
    9898                else { 
    99                     var parts = val.toString().match(/^([+-]?)([\d.]+)(.*)$/), 
     99                    var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), 
    100100                        start = e.cur(true) || 0; 
    101101 
     
    111111                        } 
    112112 
    113                         // If a +/- token was provided, we're doing a relative animation 
     113                        // If a +=/-= token was provided, we're doing a relative animation 
    114114                        if ( parts[1] ) 
    115                             end = ((parts[1] == "-" ? -1 : 1) * end) + start; 
    116  
    117             // Absolutely position numbers 
    118             if( typeof val == "number") end = val; 
     115                            end = ((parts[1] == "-=" ? -1 : 1) * end) + start; 
    119116 
    120117                        e.custom( start, end, unit ); 
     
    135132        } 
    136133 
    137         if ( !type || typeof type == "string" ) 
     134        if ( !type || (typeof type == "string" && !fn) ) 
    138135            return queue( this[0], type ); 
    139136