「テンプレート:Tooltip」の版間の差分
削除された内容 追加された内容
細編集の要約なし |
縦書き対応(border-bottomからtext-decorationに変更) |
||
1行目: | 1行目: | ||
<includeonly><b style="font-weight:inherit;cursor:help;<!-- |
<includeonly><b style="font-weight:inherit;cursor:help;<!-- |
||
ability to turn off underline dash if required (derivative use), $nodash or $3 |
ability to turn off underline dash if required (derivative use), $nodash or $3 |
||
--> {{#ifeq:{{{nodash|{{{3}}}}}}|nodash|| |
--> {{#ifeq:{{{nodash|{{{3}}}}}}|nodash||text-decoration:underline dotted cornflowerblue;}}"<!-- |
||
--> title="{{#if:{{{texttip|{{{2|}}}}}}|{{#invoke:String|replace|{{{texttip|{{{2}}}}}}|"|"}}}}">{{{target|{{{1}}}}}}</b></includeonly><noinclude> |
--> title="{{#if:{{{texttip|{{{2|}}}}}}|{{#invoke:String|replace|{{{texttip|{{{2}}}}}}|"|"}}}}">{{{target|{{{1}}}}}}</b></includeonly><noinclude> |
||
{{documentation}} |
{{documentation}} |
2019年10月3日 (木) 13:29時点における版
用途
このテンプレートによって特定の語句に関連するツールチップが可能になります。すなわち、マウス(または他のポインティングデバイス)を対象の語句の上に乗せると、別の語句が書いてある箱形の枠がポップアップします。
使用法
:({{Tooltip|J. F. R.|James Ford Rhodes}})
と入力すると、以下のようになります。
- (J. F. R.)
また、
これらの人物の多くが墓碑を生み出した。そのうちもっとも有名なものはテュルゴーの次の一節であった。“{{Tooltip|Eripuit fulmen coelo sceptrumque tyrannis.|かれは天から炎を奪った。そして王から笏 (しゃく) も。}}”
と入力すると、以下のようになります。
これらの人物の多くが墓碑を生み出した。そのうちもっとも有名なものはテュルゴーの次の一節であった。“Eripuit fulmen coelo sceptrumque tyrannis.”
引数
名称付き引数も利用可能です。
- 第1引数$1は、targetという名称の引数です。つまり、
target = J. F. R.
- 第2引数$2は、texttipという名称の引数です。つまり、
texttip = James Ford Rhodes
{{Tooltip|target = J. F. R.|texttip = James Ford Rhodes}}
- J. F. R.
応用
ウィキソースではこのテンプレートは、原文の外国語の語に対して日本語訳を提供するときに使用できます。この翻訳は箱形の枠でポップアップするため、原資料とは明確に区別されます。また、1911 Encyclopædia Britannica(英語)中の多くの記事のように、原文にイニシャル名しか書いていない場合にフルネームを補足することができます。
注
- This template is being used as the underlying template for formatting other templates, so if changes are made, especially to parameters, please check their functionality. Linked templates
- 引数
texttip
はHTMLのtitle
属性の値として埋め込まれます。これらはHTMLの要件上、引用符で囲む必要がありますが、ツールチップのポップアップ効果を有効にするために二重引用符が本テンプレートに含まれており、入力の必要はありません。