Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 30th, 2005, 09:45 AM
Orloff
Guest
 
Posts: n/a
Default popup text when the pointer is on some text

Hi,
on most (all?) browsers, when you put the pointer on a
<a href="..." title="popup text">this is a link</a>
without clicking on the link, there is a popup caption with the "popup
text".

I would like to achieve the same with some text that is not a link.
I realized that I could simply make it
<a title="popup text">this is just some text</a>

My question: is it the best way to achieve what I want?
Are there alternative ways?
Is it portable?

Thank you!
  #2  
Old July 30th, 2005, 09:55 AM
Arne
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Once upon a time *Orloff* wrote:[color=blue]
> Hi,
> on most (all?) browsers, when you put the pointer on a
> <a href="..." title="popup text">this is a link</a>
> without clicking on the link, there is a popup caption with the "popup
> text".
>
> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it
> <a title="popup text">this is just some text</a>
>
> My question: is it the best way to achieve what I want?
> Are there alternative ways?
> Is it portable?
>
> Thank you![/color]

Yes, it's the best way. However, if you like to add longer text that
wraps into several lines within the tooltip box, you need to use
Javascript (DHTML) like the examples shows here:

http://www.walterzorn.com/tooltip/tooltip_e.htm

Of course, it will not work if the browser don't support Javascript
(have Javascript disabled)

--
/Arne
My "widget" site: http://hem.bredband.net/arnel/
Top posters will be ignored. Quote the part you
are replying to, and don't quote signatures!
  #3  
Old July 30th, 2005, 11:35 AM
Orloff
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Arne wrote:
[color=blue]
> Once upon a time *Orloff* wrote:[color=green]
>> Hi,
>> on most (all?) browsers, when you put the pointer on a
>> <a href="..." title="popup text">this is a link</a>
>> without clicking on the link, there is a popup caption with the "popup
>> text".
>>
>> I would like to achieve the same with some text that is not a link.
>> I realized that I could simply make it
>> <a title="popup text">this is just some text</a>
>>
>> My question: is it the best way to achieve what I want?
>> Are there alternative ways?
>> Is it portable?
>>
>> Thank you![/color]
>
> Yes, it's the best way. However, if you like to add longer text that
> wraps into several lines within the tooltip box, you need to use
> Javascript (DHTML) like the examples shows here:
>
> http://www.walterzorn.com/tooltip/tooltip_e.htm
>
> Of course, it will not work if the browser don't support Javascript
> (have Javascript disabled)
>[/color]

Thanks Arne.
  #4  
Old July 30th, 2005, 12:55 PM
David Dorward
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Orloff wrote:
[color=blue]
> <a title="popup text">this is just some text</a>[/color]
[color=blue]
> My question: is it the best way to achieve what I want?[/color]

No. Anchors should be links or link targets.
[color=blue]
> Are there alternative ways?[/color]

Use a more suitable element. What that is depends on what the text is (e.g.
expansion of an abbreviation, a definition, etc), and could be abbr, dfn,
span, or something else.
[color=blue]
> Is it portable?[/color]

To some degree. Advisory text (which is what the title attribute holds)
shouldn't be essential reading though.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
  #5  
Old July 30th, 2005, 03:55 PM
Andy Dingley
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

On Sat, 30 Jul 2005 10:33:22 +0200, Orloff <x@hotmail.com> wrote:
[color=blue]
><a title="popup text">this is just some text</a>
>
>My question: is it the best way to achieve what I want?
>Are there alternative ways?[/color]

Just use the title attribute and put it on any element you wish - you
don't need to add spurious <a> elements.

It'll generally work, for most elements, most of the time.
  #6  
Old August 1st, 2005, 02:35 PM
Andreas Prilop
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

On Sat, 30 Jul 2005, Orloff wrote:
[color=blue]
> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it
> <a title="popup text">this is just some text</a>[/color]

This is no anchor; write
<span title="popup text">this is just some text</span>
or - better - with a meaningful element instead of "span".
For an example, see
http://www.unics.uni-hannover.de/nhtcapri/arabic.html6
which has lots of <dfn title=...>.

--
Top-posting.
What's the most irritating thing on Usenet?

  #7  
Old August 1st, 2005, 07:25 PM
Orloff
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Andreas Prilop wrote:
[color=blue]
> On Sat, 30 Jul 2005, Orloff wrote:
>[color=green]
>> I would like to achieve the same with some text that is not a link.
>> I realized that I could simply make it
>> <a title="popup text">this is just some text</a>[/color]
>
> This is no anchor; write
> <span title="popup text">this is just some text</span>
> or - better - with a meaningful element instead of "span".
> For an example, see
> http://www.unics.uni-hannover.de/nhtcapri/arabic.html6
> which has lots of <dfn title=...>.
>[/color]

Thank you.
  #8  
Old August 14th, 2005, 06:15 AM
Gérard Talbot
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Orloff wrote :[color=blue]
> Hi,
> on most (all?) browsers, when you put the pointer on a
> <a href="..." title="popup text">this is a link</a>
> without clicking on the link, there is a popup caption with the "popup
> text".
>[/color]

Such popup caption purpose was specifically defined in the W3C specs and
various documents (WAI, HTML 4.01, WCAG). It should be short (under 100
characters) and it should only be used to add additional, complementary
info to the link text like defining the target of the link or mode of
opening the referenced resource (like opening a new secondary window).
The W3C documents insist on defining a meaningful link text, which can
be understood even without its context.
[color=blue]
> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it
> <a title="popup text">this is just some text</a>
>
> My question: is it the best way to achieve what I want?[/color]

It depends on the element. The W3C documents discourage explicitly to
use title attribute on the following elements:

table
caption
img

and the W3C documents encourage explicitly to use title attribute when
needed, when it can help for the following elements:

a
abbr
acronym
frame
[color=blue]
> Are there alternative ways?
> Is it portable?[/color]

Many user agents will not render the title attribute in a tooltip or
elsewhere: most text browsers. Keyboard navigation will not render the
title attribute in visual browsers.
What's important to remember is that the title attribute should be short
and should not hold crucial, important info in order to understand the
document or to navigate in the document.

Gérard
--
remove blah to email me
  #9  
Old August 14th, 2005, 09:15 PM
David Ross
Guest
 
Posts: n/a
Default Re: popup text when the pointer is on some text

Gérard Talbot wrote:[color=blue]
>
> Orloff wrote :[color=green]
> > Hi,
> > on most (all?) browsers, when you put the pointer on a
> > <a href="..." title="popup text">this is a link</a>
> > without clicking on the link, there is a popup caption with the "popup
> > text".
> >[/color]
>
> Such popup caption purpose was specifically defined in the W3C specs and
> various documents (WAI, HTML 4.01, WCAG). It should be short (under 100
> characters) and it should only be used to add additional, complementary
> info to the link text like defining the target of the link or mode of
> opening the referenced resource (like opening a new secondary window).
> The W3C documents insist on defining a meaningful link text, which can
> be understood even without its context.
>[color=green]
> > I would like to achieve the same with some text that is not a link.
> > I realized that I could simply make it
> > <a title="popup text">this is just some text</a>
> >
> > My question: is it the best way to achieve what I want?[/color]
>
> It depends on the element. The W3C documents discourage explicitly to
> use title attribute on the following elements:
>
> table
> caption
> img
>
> and the W3C documents encourage explicitly to use title attribute when
> needed, when it can help for the following elements:
>
> a
> abbr
> acronym
> frame
>[color=green]
> > Are there alternative ways?
> > Is it portable?[/color]
>
> Many user agents will not render the title attribute in a tooltip or
> elsewhere: most text browsers. Keyboard navigation will not render the
> title attribute in visual browsers.
> What's important to remember is that the title attribute should be short
> and should not hold crucial, important info in order to understand the
> document or to navigate in the document.[/color]

Per the HTML 4.01 specification, the title attribute is allowed for
all elements except BASE, BASEFONT, HEAD, HTML, META, PARAM,
SCRIPT, and TITLE. Note that these eight elements do not create
visible content over which a cursor can be placed.

The specification does not indicate that the title attribute is
decprecated for the table, caption, or img elements. Indeed,
others strongly recommend the title attribute for the img element
where the Web author expects the alt attribute to produce a tooltip
for a visible image with a visual browser. They would reserve the
alt attribute only for situations in which the image is not
visible, not for producing a tooltip over a visible image. They
take the specification's description of the alt attribute:
"For user agents that cannot display images,
forms, or applets, this attribute specifies
alternate text."
as prohibiting any other use. Thus, the title attribute is
appropriate for such things as indicating copyright information for
an image or describing a link in which the image is the only inline
content of the anchor element.

Where my own pages have thumbnails of photographs as links to other
pages that have the full-sized photos, I use the title attribute in
the img tags (the inline contents of the links) to indicate the
download sizes of the pages with the full-size photos. These are
useful warnings for those users (almost half of those who access
the Internet from home) who still use dial-up modems.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles