DynRuby provides "smart" ruby annotations that are displayed on hover, and works with any browser with support for ruby annotations. DynRuby is designed for displaying Furigana 振り仮名 annotations for Japanese Kanji 漢字, but can also be used with Chinese to display phonetic notations with Hanyu Pinyin 汉语拼音 or Bopomofo/Zhuyin Fuhao 注音符號. Note that Zhuyin Fuhao are usually displayed vertically, and might not be displayed correctly if rendered horizontally.

The Kanji in the following lyric snippet are annotated with Hiragana as Furigana. Simply move your mouse on to the characters and you'll see the annotations!

Star Fork

from ING by Morning Musume (モーニング。)

いつまでも 二人でいたい
パンがつなら わけわけね
また 実際 しね
ての まりね
恋愛 進行形
Show all annotations | Hide all annotations

Example of mixing persistent and dynamic annotations:

from "Just be yourself" by The World Standard (わーすた)

ゆめゆめ パステル 時間宝石箱
10年後 30年後 過去になった“イマ”を
いて プリパラ
Show all annotations Hide all annotations

How do you use DynRuby in your own HTML? Just write:

<ruby class="dyn-ruby" data-annotation="カン">漢</ruby>
and you would get: !

To use persistent annotations, write:

<ruby class="dyn-ruby-p" data-annotation="カン">漢</ruby>
and you would get: . The effect is the same as writing all the HTML by yourself, and it's more like just a shorthand.

I also provided two "magic links" that displays/hides all DynRuby annotations on click. Once they are displayed this way, they do not respond to hover anymore (until they are hidden by the "hide" link):
"Show: <a class="show-dyn-ruby" href="#">Text here</a>.
"Hide": <a class="hide-dyn-ruby" href="#">Text here</a>.

Of course, don't forget <script src="https://raw.githubusercontent.com/xuanruiqi/dynruby/master/dyn-ruby.js"></script>. DynRuby relies on jQuery, so also make sure that you have included jQuery.