From 13057aa4162869b6b9424243967fa7a3b1fef5ec Mon Sep 17 00:00:00 2001
From: Jon Tascher
+ 0:10
+
+ 20.00:00:00
+
+ 0
+
+ 0
+
+ 0:00.0
+
+
+ Examples
+
+ <span class="counter counter-analog" data-direction="down">0:10</span>
+ <script>
+ $('.counter').counter({});
+ </script>
+
+
+ <span class="counter counter-analog" data-direction="down" data-format="20.23:59:59">20.00:00:00</span>
+ <script>
+ $('.counter').counter({});
+ </script>
+
+
+ <span class="counter counter-analog" data-direction="up" data-interval="1" data-format="9999" data-stop="2012">0</span>
+ <script>
+ $('.counter').counter({});
+ </script>
+
+
+ <span class="counter counter-analog" data-direction="up" data-format="1 1 1 1 1 1 1 1" data-stop="0 0 1 0 0 0 0 0" data-interval="100">0</span>
+ <script>
+ $('.counter').counter({});
+ </script>
+
+ Style counter-analog2
+
+ <span class="counter counter-analog2" data-direction="up" data-format="23:59:59.9" data-stop="00:00:10.0" data-interval="100">0:00.0</span>
+ <script>
+ $('.counter').counter({});
+ </script>
+
+ Full Javascript Initialization
+
+ <span id="custom"></span>
+ <script>
+ $('#custom').addClass('counter-analog').counter({
+ initial: '0:00.0',
+ direction: 'up',
+ interval: '1',
+ format: '9999',
+ stop: '2012'
+ });
+ </script>
+
+
+ <script> + $('.counter').on('counterStop', function() { + //code + }); + </script> ++ + + diff --git a/src/jquery.counter.js b/src/jquery.counter.js index 71a14cf..cb25d6d 100644 --- a/src/jquery.counter.js +++ b/src/jquery.counter.js @@ -5,9 +5,9 @@ * MIT License */ -!(function (context, definition) { +!(function (context, definition, $) { if (typeof define == 'function' && typeof define.amd == 'object') define(['jquery'], definition); - else definition(context['$']); + else definition($); }(this, function ($) { var checkStop = function(data) { @@ -239,4 +239,4 @@ } }; -})); +}, jQuery));