خرید بک لینک

Vote count: 0

I'm trying to reuse some code that existed in a theme I used a while back. I can't seem to get it to work on its own.

It should simply take the value in the HTML and animate the digits like a counter, quickly.

https://jsfiddle.net/96roocq1/1/

or the JS/CSS/HTML below:

<div class="counter_holder center" style="color:#ffffff; font-size:168px;">

  <span class="counter type1" data-delay="" style="background-color: black; height:168px; line-height:168px;">1678</span>

</div>


.counter_holder {
  display: block;
  opacity: 0;
  filter: alpha(opacity: 0);
  -webkit-transition: opacity 0.3s ease 0s;
  -moz-transition: opacity 0.3s ease 0s;
  -o-transition: opacity 0.3s ease 0s;
  width: 100%;
  font-size: 150px;
  line-height: 150px;
}

.counter_holder.left {
  text-align: left;
}

.counter_holder.right {
  text-align: right;
}

.counter_holder.center {
  text-align: center;
}

.counter_holder span.counter {
  font-family: "Oswald", sans-serif;
  overflow: hidden;
  display: inline-block !important;
  text-align: center;
  height: 150px;
  font-size: inherit;
  line-height: inherit;
}

.counter_holder h4 {
  margin: 30px 0px 0px;
}

.counter_holder p {
  margin: 18px 0px 0px;
}

.tocounter {
  float: none;
  margin: 0px;
}


function initToCounter() {
  "use strict";

  if ($j('.counter.type1').length) {
    $j('.counter.type1').each(function() {

      var delay = $j(this).data('delay');
      var time = 0;

      if (delay !== "" && delay !== 0) {
        time = delay;
      }

      var $this = $j(this);

      if ($j('.touch .no_delay').length) {
        $this.parent().css('opacity', '1');
        var $max = parseFloat($this.text());
        $this.countTo({
          from: 0,
          to: $max,
          speed: 1500,
          refreshInterval: 50
        });
        resizeFonts();
      } else {
        $this.appear(function() {
          setTimeout(function() {
            $this.parent().css('opacity', '1');
            var $max = parseFloat($this.text());
            $this.countTo({
              from: 0,
              to: $max,
              speed: 1500,
              refreshInterval: 50
            });
            resizeFonts();
          }, time);
        }, {
          accX: 0,
          accY: -200
        });
      }

    });
  }
}

Thanks.

asked 32 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 9 خرداد 1395 ساعت: 1:59

صفحه بندی