今日の人気記事

  1. さまざまな要素をツールチップで表示「DarkTooltip」

数値をアニメーションでカウントアップ「Numerator」

当ページのリンクには広告が含まれています。

スポンサーリンク

数値をアニメーションでカウントアップするプラグイン「Numerator」を紹介します。

jQueryプラグイン「Numerator」

このプラグインを使えば、数値を少しずつ増やしていくカウントアップをアニメ効果付きで実装することができます。

以下のような豊富なオプションが用意されています。

  • アニメ効果
  • カウントアップの時間
  • 3桁区切りの記号
  • 小数点以下の桁数
  • カウントアップする数値
  • カウントアップ開始時の関数
  • カウントアップ終了時の関数
スポンサーリンク

それではデモページのカウントアップをご覧ください。

「Numerator」のデモ

デモのソース(HTML + jQuery)

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Numerator のデモでーす。">
<title>Numerator - jQuery Plugin Demo</title>
</head>
<body>
<h1>Numerator のデモ。</h1>

<p class="demo"></p>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="jquery-numerator.js"></script>
<script>
$(document).ready(function() {
  $('.demo').numerator({
    easing: 'swing',
    duration: 10000,
    toValue: 10000,
    delimiter: '#',
    rounding: 2,
    onComplete: function(){
      alert('完!')
    }
  });
});
</script>

<footer style="margin-top:20px;">
<a href="https://webkaru.net/jquery-plugin/numerator/">「jQueryプラグインまとめ」に戻る</a>
</footer>
</body>
</html>
スポンサーリンク

関連記事(一部広告含む)