473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

toggle kana/kanji

I have a page (ok, will have a page) written in Japanese. As we all
know, Japanese is written with some pretty funky characters, and it is
conventional to write the so-called furigana above these kanji, as a
pronunciation guide. Imagine it as lots of little inline tables as
follows:

za kat sed hau du yu du
The cat said how do you do

This can be rendered properly using the html <RUBY> tag. Unfortunately,
that tag is not properly supported across browsers, and msie, the only
one I know that does support it, wont allow it to be manipulated
properly by javascript. So I think it is best avoided.

Anyhow, what I want is the following:

The ability to toggle individual kanji/furigana pairings by clicking on
that bit of text. Ideally, this will involve an absolute minimum of
coding within the body of the document, as I expect there will be many
such pairs.

How can I do this?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #1
3 2182
In article <bt************@ID-174912.news.uni-berlin.de>,
"Fabian" <la****@hotmail.com> wrote:
I have a page (ok, will have a page) written in Japanese. As we all
know, Japanese is written with some pretty funky characters, and it is
conventional to write the so-called furigana above these kanji, as a
pronunciation guide. Imagine it as lots of little inline tables as
follows:

za kat sed hau du yu du
The cat said how do you do

This can be rendered properly using the html <RUBY> tag. Unfortunately,
that tag is not properly supported across browsers, and msie, the only
one I know that does support it, wont allow it to be manipulated
properly by javascript. So I think it is best avoided.

Anyhow, what I want is the following:

The ability to toggle individual kanji/furigana pairings by clicking on
that bit of text. Ideally, this will involve an absolute minimum of
coding within the body of the document, as I expect there will be many
such pairs.

How can I do this?


I think you'll have to use fairly large kanji that match up with the
smallest font size you can get for the kana (but make them large enough
to read on a crappy display). then play around with tables. Once you
have them positioned, you can put <div> tags inside the table cells and
make things appear and disappear.

Neat idea of you can do it. I've just been working on having the reading
appear in a line after the kanji.
Jul 20 '05 #2
Fabian wrote:
I have a page (ok, will have a page) written in Japanese. As we all
know, Japanese is written with some pretty funky characters,
AFAIK Japanese has glyphs, not characters. But understood.
This can be rendered properly using the html <RUBY> tag.
(X)HTML does not have a <RUBY> tag. In fact, _W3C's_ Ruby (apparently
there is an object-oriented scripting language of the same name[1]) is
another markup language which can be embedded in XHTML 1.1 documents
through a module for XHTML 1.1.[2] The "ruby" element is, of course,
the root element of the embedded markup.

[1] http://www.ruby-lang.org/en/
[2] http://www.w3.org/TR/ruby/
Unfortunately, that tag is not properly supported across browsers,
As XHTML is not, alas.
and msie, the only one I know that does support it, wont allow it
to be manipulated properly by javascript. So I think it is best
avoided.
Why not admit that IE is not capable and serve it (and
other not-supporting UAs) a page without Ruby markup?
The ability to toggle individual kanji/furigana pairings by clicking on
that bit of text. Ideally, this will involve an absolute minimum of
coding within the body of the document, as I expect there will be many
such pairs.

How can I do this?


There is a good[tm] and a bad[tm] solution.

The good[tm] one is CSS.

CSS2, using floats and toggling child elements of each float:
<http://www.w3.org/TR/CSS2/visuren.html#floats>

CSS3, using its Ruby Module (not yet a recommendation) and
toggling properties of child elements:
<http://www.w3.org/TR/css3-ruby/>

The bad[tm] one is tables, toggling the visibility of table
cells ([X]HTML "td" elements).

Note that "click" events bubble by default.
HTH

PointedEars
Jul 20 '05 #3
Thomas 'PointedEars' Lahn hu kiteb:
Fabian wrote:
I have a page (ok, will have a page) written in Japanese. As we all
know, Japanese is written with some pretty funky characters,
AFAIK Japanese has glyphs, not characters. But understood.


For all practial purposes, the two words have the same meaning. The only
reason Japanese people don't call them characters is because
'kyarakutaa' means things like Mickey Mouse, Fred Flintstone, or the
Stay-Puffed Marshmallow Man.

This can be rendered properly using the html <RUBY> tag.


(X)HTML does not have a <RUBY> tag. In fact, _W3C's_ Ruby (apparently
there is an object-oriented scripting language of the same name[1]) is
another markup language which can be embedded in XHTML 1.1 documents
through a module for XHTML 1.1.[2] The "ruby" element is, of course,
the root element of the embedded markup.

[1] http://www.ruby-lang.org/en/
[2] http://www.w3.org/TR/ruby/
Unfortunately, that tag is not properly supported across browsers,


As XHTML is not, alas.
and msie, the only one I know that does support it, wont allow it
to be manipulated properly by javascript. So I think it is best
avoided.


Why not admit that IE is not capable and serve it (and
other not-supporting UAs) a page without Ruby markup?


What I want is a solution whereby by default the user agent will see one
of:

ruby
text

or

text(ruby)

Depending on the capabilities of the agent. Further, I want the user to
have teh option to toggle the display of the text and ruby. There will
be 3 options:

Show all
Show base text only
Show ruby only

Ideally it will be functional it at least both msie and netscape (latest
versions).

The main problem I have is that msie won't allow the <ruby> tags to be
manipulated via javascript.
There is a good[tm] and a bad[tm] solution.

The good[tm] one is CSS.

CSS2, using floats and toggling child elements of each float:
<http://www.w3.org/TR/CSS2/visuren.html#floats>
From the example they give, this would be a great way to do drop-caps,
but since the main text will flow around both sides, I'm not sure it
would work. On really long examples, the ideal display would be
interleaved lines.

CSS3, using its Ruby Module (not yet a recommendation) and
toggling properties of child elements:
<http://www.w3.org/TR/css3-ruby/>

Since there is no browser (no common one anyway) that both understands
the ruby tagset and allows it to be manipulated, I'll pass on this
solution.

I think I'll have to give this one up as a not yet possible across
browsers task.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
11
by: MLH | last post by:
Why is that? If I choose the tiny check boxes which are hard to hit with a mouse, it works fine. But option buttions, shich can be sized big enough for people with limited sight and dexterity...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
9
by: tomrmgc | last post by:
Here is the problem we've encountered. An application that used to successfully display Japanese Kanji characters no longer does so when recompiled with 7.1 When compiled with the 6.0 compiler,...
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
50
by: sksoule | last post by:
Hi, Can anyone please tell me how to toggle a nth bit. For example, I am having a variable which is of 8 bits. I want to toggle the nth bit. Regards, Santosh
2
by: jai04082000 | last post by:
Hi all, Please guide me, I am involved in migration of some of the Excel files of MS EXCEL ( Japanese - Kanji ) into DB2/400. I am new to this env so If I am asking foolish question, forgive...
1
by: swiftouch | last post by:
I'm getting an error message in FF2.0: document.getElementById(toggle) has no properties The goal of the script is, when I hover my mouse over an image, to make one div element visible while...
0
by: uthnak | last post by:
Dear All, I have a program when in I key in a chinese word(Kanji) and give its equivalent word in English and Save. I have a peculiar problem. I enter a Chinese word, or paste a chinese...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.