Anxious to learn some skills

F

futurepy

Hello,

I am not good at JS at all. If you are reading this message with the
IE, please move the cursor up to the top of the page. When the cursor
stops at an icon, a rectangle slot will appear, and there is text in
the slot, saying 'Back to ...', 'Stop', 'Home', 'Refresh', etc.

This is what I like to learn. In my own web page, when the reader
moves the cursor to a word, sentence or URL address, I would like to
have a rectangle slot to appear, and some text in it to explain what
it is.

I believe this is very easy for many people here. Thanks for help.
 
G

Grant Wagner

Andrew said:
This is successfully achieved with markup-alone via the 'text'
attribute, see:
http://www.w3.org/TR/html4/struct/global.html#adef-title

I think you meant the TITLE attribute.

<a href="http://www.yahoo.com" title="Links to Yahoo! in a new window"
target="_blank">Yahoo!</a>

You can also assign TITLE attributes to arbitrary text using the SPAN
element, but then there really isn't a hint that hovering over the text will
result in a TITLE:

<span title="Stuff">This is some text</span>

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 
F

futurepy

Grant Wagner said:
I think you meant the TITLE attribute.

<a href="http://www.yahoo.com" title="Links to Yahoo! in a new window"
target="_blank">Yahoo!</a>

You can also assign TITLE attributes to arbitrary text using the SPAN
element, but then there really isn't a hint that hovering over the text will
result in a TITLE:

<span title="Stuff">This is some text</span>

Thank everybody very much. The <span title="stuff">text</span> is what
I need for the moment. I have two more questions.

First, I need to make some special characters, such as IPA letters in
the unicode and superscript numerals, to appear in the slot. I tried,
but no success. For instance, after placing a unicode, such as
ŋ, or <sup>1</sup>, between the quotation marks for the Tittle
attribute, the whole thing simply does not show up. It seems that any
symbol can appear in the slot. I have seen some Asian script in
there. But I just don't know what to do.

Another question is that whether the size of the slot, such as its
height, or size of the letters in the slot, can be adjusted. Or can
the slot's background color be changed?

Thanks again.
 
F

futurepy

Thank everybody very much. The <span title="stuff">text</span> is what
I need for the moment. I have two more questions.

First, I need to make some special characters, such as IPA letters in
the unicode and superscript numerals, to appear in the slot. I tried,
but no success. For instance, after placing a unicode, such as
ŋ, or <sup>1</sup>, between the quotation marks for the Tittle
attribute, the whole thing simply does not show up. It seems that any
symbol can appear in the slot. I have seen some Asian script in
there. But I just don't know what to do.

Another question is that whether the size of the slot, such as its
height, or size of the letters in the slot, can be adjusted. Or can
the slot's background color be changed?

Thanks again.

I tried again. The unicode worked, but the html tags didn't. For
instance, I tried to use the <br/> tag to move part of text to another
line, but it didn't work. Is there a way to present multi-line text
with the 'title' attribute?

In my page, when moving the cursor to the <span title="">text</span>,
it becomes a very thin vertical bar. In others' professional pages,
the cursor either remains the arrow or becomes a hand, which is much
better. Is there a way that either can be achieved with the 'title'
attribute?

Thanks again.
 
G

Grant Wagner

futurepy said:
I tried again. The unicode worked, but the html tags didn't. For
instance, I tried to use the <br/> tag to move part of text to another
line, but it didn't work. Is there a way to present multi-line text
with the 'title' attribute?

No, the display of the TITLE attribute is entirely platform and browser dependant. In some browsers (such as
Netscape 4.8) it does not show up at all. I'd think the TITLE attribute probably doesn't show up in PDA
browsers either, given their UI limitations.
In my page, when moving the cursor to the <span title="">text</span>,
it becomes a very thin vertical bar. In others' professional pages,
the cursor either remains the arrow or becomes a hand, which is much
better. Is there a way that either can be achieved with the 'title'
attribute?

The behaviour you are seeing has nothing to do with the TITLE attribute. The "vertical bar" cursor is for
text selection, and appears anywhere you mouse over plain text on any page. This is why I suggested not
using <span></span>, since there is no suggestion to the user at all that the text provides additional
functionality.

However, if you want to change the cursor, you could use CSS:

<span title="text" style="cursor:default;">text</span>

or

<head>
....
<style type="text/css">
span.defaultCursor { cursor: default; }
</style>
</head>
....
<span title="text" class="defaultCursor">test</span>

I'd suggest you get a good book on HTML and CSS (or do reading on the Web). All this is way off-topic for
comp.lang.javascript, you should take any future questions to more appropriate newsgroups.

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top