Skip to content

Instantly share code, notes, and snippets.

@14021939
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 14021939/1678a1031ad2c7cfd021 to your computer and use it in GitHub Desktop.
Save 14021939/1678a1031ad2c7cfd021 to your computer and use it in GitHub Desktop.
jquery UI Tooltipで独自のクラスを指定してスタイルを設定する ref: http://qiita.com/14021939/items/ab1b5910373e31118a54
.ui-tooltip{background: #F2FBEF}
.ui-tooltip1{color:red;}
.ui-tooltip2{font-style: italic;}
.ui-tooltip3{font-weight:borld;}
.ui-tooltip-test{background:red;color:white;}
<p>これは<a class="test1" href="#" title="てすと1">ツールチップのテスト</a>です。ツールチップごとに異なるスタイルを指定しています。</p>
<p>これは<a class="test2" href="#" title="てすと2">ツールチップのテスト</a>です。ツールチップごとに異なるスタイルを指定しています。</p>
<p>これは<a class="test3" href="#" title="てすと3">ツールチップのテスト</a>です。ツールチップごとに異なるスタイルを指定しています。</p>
<p>共通のstyleは".ui-tooltip"クラスで指定しています。</p>
<p><label for="test">test:</label><input id="test" title="test" /></p>
<p>リンクやフィールドをマウスオーバーするとツールチップが表示されます。</p>
$(function() {
$(".test1").tooltip({
tooltipClass:"ui-tooltip1"
});
$(".test2").tooltip({
tooltipClass:"ui-tooltip2"
});
$(".test3").tooltip({
tooltipClass:"ui-tooltip3"
});
$("#test").tooltip({
tooltipClass:"ui-tooltip-test"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment