jhon2015 / jquery-countdown

Automatically exported from code.google.com/p/jquery-countdown
0 stars 0 forks source link

An improvement, this fixes most of the issues and add the posibility to make it any size #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
//changed this line "background-size": options.digitWidth+'px 100%',
 var createDigits = function(where) 
  {
    var c = 0;
    // Iterate each startTime digit, if it is not a digit
    // we'll asume that it's a separator
    for (var i = 0; i < options.startTime.length; i++)
    {
      if (parseInt(options.startTime[i]) >= 0) 
      {
        elem = $('<div id="cnt_' + i + '" class="cntDigit" />').css({
          height: options.digitHeight * options.digitImages * 10, 
          float: 'left',
          background: "url('" + options.image + "')",
          "background-size": options.digitWidth+'px 100%',
          width: options.digitWidth});
        digits.push(elem);
        margin(c, -((parseInt(options.startTime[i]) * options.digitHeight *
                              options.digitImages)));
        digits[c].__max = 9;
        // Add max digits, for example, first digit of minutes (mm) has 
        // a max of 5. Conditional max is used when the left digit has reach
        // the max. For example second "hours" digit has a conditional max of 4 
        switch (options.format[i]) {
          case 'h':
            digits[c].__max = (c % 2 == 0) ? 2: 9;
            if (c % 2 == 0)
              digits[c].__condmax = 4;
            break;
          case 'd': 
            digits[c].__max = 9;
            break;
          case 'm':
          case 's':
            digits[c].__max = (c % 2 == 0) ? 5: 9;
        }
        ++c;
      }
      else 
        elem = $('<div class="cntSeparator"/>').css({float: 'left'})
                .text(options.startTime[i]);

      where.append(elem)
    }
  };

Original issue reported on code.google.com by qaseria...@gmail.com on 2 Aug 2013 at 4:50

GoogleCodeExporter commented 9 years ago
Thank's, that's work fine!!!

Original comment by vidal.fe...@gmail.com on 2 Apr 2014 at 4:35