jquery.trend.js
function(el, properties) {
    var duration = 0;

    for (var i = 0; i < properties.length; i++) {
      // Get raw CSS value
      var value = el.css(properties[i]);
      if (!value) continue;

      // Multiple transitions--pick the longest
      if (value.indexOf(",") !== -1) {
        var values = value.split(",");
        var durations = (function(){
          var results = [];
          for (var i = 0; i < values.length; i++) {
            var duration = parseTime(values[i]);
            results.push(duration);
          }
          return results;
        })();

        duration = Math.max.apply(Math, durations);
      }

      // Single transition
      else {
        duration = parseTime(value);
      }

      // Accept first vaue
      break;
    }

    return duration;
  }
function(el, properties) {
    var duration = 0;

    for (var i = 0; i < properties.length; i++) {
      // Get raw CSS value
      var value = el.css(properties[i]);
      if (!value) continue;

      // Multiple transitions--pick the longest
      if (value.indexOf(",") !== -1) {
        var values = value.split(",");
        var durations = (function(){
          var results = [];
          for (var i = 0; i < values.length; i++) {
            var duration = parseTime(values[i]);
            results.push(duration);
          }
          return results;
        })();

        duration = Math.max.apply(Math, durations);
      }

      // Single transition
      else {
        duration = parseTime(value);
      }

      // Accept first vaue
      break;
    }

    return duration;
  }
function ( el , properties ) { var duration = 0 ; for ( var i = 0 ; i < properties . length ; i ++ ) { // Get raw CSS value var value = el . css ( properties [ i ] ) ; if ( ! value ) continue ; // Multiple transitions--pick the longest if ( value . indexOf ( "," ) !== - 1 ) { var values = value . split ( "," ) ; var durations = ( function ( ) { var results = [ ] ; for ( var i = 0 ; i < values . length ; i ++ ) { var duration = parseTime ( values [ i ] ) ; results . push ( duration ) ; } return results ; } ) ( ) ; duration = Math . max . apply ( Math , durations ) ; } // Single transition else { duration = parseTime ( value ) ; } // Accept first vaue break ; } return duration ; }
Parses the longest time unit found in a series of CSS properties. Returns a value in milliseconds.
Parses the longest time unit found in a series of CSS properties . Returns a value in milliseconds .