本日ラスト、5つめはTooltipです。
5.Tooltipのサンプルスクリプト
ユーザの入力補助機能としてつけておいてあげたいですね。
<html lang="ja">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>$(function(){$( document ).tooltip();});</script>
</head>
<body>
<p><a href="#" title="リンクに付随したツールチップです">Tooltips</a>
<p><input id="tool" title="inputタグに付随したツールチップです" /></p>
</body>
</html>
→リンクやテキストボックスにマウスオーバーするとヘルプが表示されます。
6.まとめ
いかがだったでしょうか。5つともほぼデフォルト設定のサンプルになっていますので、
慣れてきたらいろいろオプション設定を加えてカスタマイズしてみてください。
次回はエフェクト編です。
7.参考ページ
jQueryUI公式サイト:http://jqueryui.com/
jQuery 日本語リファレンス:http://js.studio-kingdom.com/jqueryui/widgets