diff --git a/examples/simple-noconflict.html b/examples/simple-noconflict.html new file mode 100644 index 0000000..aba6901 --- /dev/null +++ b/examples/simple-noconflict.html @@ -0,0 +1,99 @@ + + +
+ + ++ 0:10 +
++ <span class="counter counter-analog" data-direction="down">0:10</span> + <script> + $('.counter').counter({}); + </script> ++
+ 20.00:00:00 +
++ <span class="counter counter-analog" data-direction="down" data-format="20.23:59:59">20.00:00:00</span> + <script> + $('.counter').counter({}); + </script> ++
+ 0 +
++ <span class="counter counter-analog" data-direction="up" data-interval="1" data-format="9999" data-stop="2012">0</span> + <script> + $('.counter').counter({}); + </script> ++
+ 0 +
++ <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> ++
+ 0:00.0 +
++ <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> ++
+ +
+ <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));