Any way to specify alt text timeout in seconds?

C

Chris Ianson

Hi all,

Well having found this group to be a fountain of knowledge I have another
question. And hey, no worries if you don't know or don't want to answer,
please ignore this.

Is there a way to change the timeout of a tooltip AKA alt text over a
picture? Normally the text appears for about 5 seconds then vanishes, but
I'd like it to stay indefinitely on a specific picture. (It's a photo with
a description of the photo).

Any ideas? Thanks in advance :)
 
D

Dylan Parry

Pondering the eternal question of "Hobnobs or Rich Tea?", Chris Ianson
finally proclaimed:
Is there a way to change the timeout of a tooltip AKA alt text over a
picture?

It's only Internet Explorer that does this with alt text. Other browsers
don't exhibit this behaviour for alt attributes, but may show tooltips
for title attributes.
Normally the text appears for about 5 seconds then vanishes, but
I'd like it to stay indefinitely on a specific picture. (It's a photo with
a description of the photo).

You can't do this for the actual alt/title text, but you might be able
to use Javascript to give the same effect.

http://www.kryogenix.org/code/browser/nicetitle/

has something that does this sort of thing. To be entirely honest
though, if it is a description of the image then it shouldn't be in the
alt attribute anyway - the alt attribute is a *replacement* for the
image in the event that the image cannot be seen, not a description.

The title attribute (which is what the above script uses) is probably
better suited to this, but if the text you plan on using is fundamental
content then you should really write it on the page rather than hide it
away as an attribute.
 
B

Benjamin Niemann

Chris said:
Hi all,

Well having found this group to be a fountain of knowledge I have another
question. And hey, no worries if you don't know or don't want to answer,
please ignore this.

Is there a way to change the timeout of a tooltip AKA alt text over a
picture? Normally the text appears for about 5 seconds then vanishes, but
I'd like it to stay indefinitely on a specific picture. (It's a photo
with a description of the photo).

No, there's no way to do this. And the ALT attribute is not supposed to be
used for the tooltip anyway - it's the text that should be displayed, if
the image cannot be display for whatever reason. Use the TITLE attribute
for additional information about the image. And no, you can't control how
the browser displays the TITLE attribute either.
 
S

Spartanicus

Chris Ianson said:
Well having found this group to be a fountain of knowledge

What group? You cross posted.
Is there a way to change the timeout of a tooltip AKA alt text over a
picture?

How to specify alternate text: (and what it is for)
http://www.w3.org/TR/html4/struct/objects.html#alternate-text

It's not supposed to be presented as a "tooltip" (common graphical
browsers), only IE exhibits this behaviour. Advisory title content
should be coded with the HTML title attribute, use that and even IE will
display it as a "tooltip".
Normally the text appears for about 5 seconds then vanishes, but
I'd like it to stay indefinitely on a specific picture. (It's a photo with
a description of the photo).

It's a browser property, a user may be able to change it in their
browser, an author has no control over it.

JS can probably be used to generate "tooltip like" widgets, using that
you probably have some control over the time it's displayed.
 
C

Chris Ianson

You can't do this for the actual alt/title text, but you might be able
to use Javascript to give the same effect.

http://www.kryogenix.org/code/browser/nicetitle/

Thanks, I had a look and whilst that works great for the title attrib of
hyperlinks, it doesn't seem to be able to affect images :(

Also, I need to remove the destination URL from the popup title.
has something that does this sort of thing. To be entirely honest
though, if it is a description of the image then it shouldn't be in the
alt attribute anyway - the alt attribute is a *replacement* for the
image in the event that the image cannot be seen, not a description.

I agree. I have changed the attrib to 'title' for my images, which still
gives the tooltip in IE, however I'd like to get nicetitle working for it.
Any ideas?
The title attribute (which is what the above script uses) is probably
better suited to this, but if the text you plan on using is fundamental
content then you should really write it on the page rather than hide it
away as an attribute.

Due to a lack of room and a penchant for neatness, I am having it so people
hover over an image for info on it. It works nice in IE at least, other
than it disappears after 5 seconds :(

Any ideas?

Thanks :)
 
D

dorayme

Chris Ianson said:
Due to a lack of room and a penchant for neatness, I am having it so people
hover over an image for info on it. It works nice in IE at least, other
than it disappears after 5 seconds :(

Any ideas?

I would take Dylan Parry's advice about including important
descriptions in the text of "the" or "a" page. You could work
with the title tooltip (I agree, annoyingly timing-out) by
keeping the tooltip very short and easy to read, perhaps even
with a pointer to more elsewhere... like "see more at right
panel" or something...)

What is the purpose of this time out? Surely the timeout should
be very quick when the mouse leaves the area, not when it might
be deliberately hovering over the area concerned?
 
C

Chris Ianson

I would take Dylan Parry's advice about including important
descriptions in the text of "the" or "a" page. You could work
with the title tooltip (I agree, annoyingly timing-out) by
keeping the tooltip very short and easy to read, perhaps even
with a pointer to more elsewhere... like "see more at right
panel" or something...)

Thanks, that is an answer, although a JS solution would be nicer.
'nicetitle' works great for hyperlink screentips.

Is it true that alt= only acts as a tooltip in IE, whereas title= works as a
tooltip in all browsers? If so, is the timeout the same as with IE?
What is the purpose of this time out? Surely the timeout should
be very quick when the mouse leaves the area, not when it might
be deliberately hovering over the area concerned?

I agree! Perhaps Bill thinks we have short attention spans. Now what was
my name again?...
 
D

dorayme

Chris Ianson said:
Thanks, that is an answer, although a JS solution would be nicer.
'nicetitle' works great for hyperlink screentips.

Yes, perhaps for those who have js on. There are a chunk of folk
who do not, this might vary between classes... The big point is
this, if it quite important info, best not to rely on js.
Is it true that alt= only acts as a tooltip in IE, whereas title= works as a
tooltip in all browsers? If so, is the timeout the same as with IE?

alt does not trip any tooltip text on my MacIE but title, of
course, does. Nor on other browsers that I have noticed. Safari
does have a longer time, 10 sec!
I agree! Perhaps Bill thinks we have short attention spans. Now what was
my name again?...

I had supposed there might be this reason, but really, I am no
js/browser interaction expert: if it did not disappear quickly
there would be left a trail of tooltips around. But this is not
so, Safari hangs on only when the mouse is appropriately
positioned. Anyone know the reason for a timeout, given that if a
user moves away, it stops anyway? Soon as I post this, I will
think of something. Or not!
 
J

Jonathan N. Little

dorayme wrote:
I had supposed there might be this reason, but really, I am no
js/browser interaction expert: if it did not disappear quickly
there would be left a trail of tooltips around. But this is not
so, Safari hangs on only when the mouse is appropriately
positioned. Anyone know the reason for a timeout, given that if a
user moves away, it stops anyway? Soon as I post this, I will
think of something. Or not!
I believe the browser tooltip balloon it browser is browser dependent on
A) whether on not it is displayed and B) for how long...it is not
scriptable. If you have information that it really important then it
should be in your content and do not rely on the tooltip. The title
attribute should be for auxiliary information only.
 
N

Neredbojias

Thanks, that is an answer, although a JS solution would be nicer.
'nicetitle' works great for hyperlink screentips.

What you probably want could be done with css hover by including an
invisible, positioned box in each link, then showing it on hover. Google
for "css hover" methods.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Wed, 5 Apr
2006 03:17:38 remote, seen in Thomas
'PointedEars' Lahn said:
All of this is very off topic in comp.lang.javascript. Please stop
crossposting, especially from alt.* into Usenet (here: comp.*).

<URL:http://en.wikipedia.org/wiki/Usenet>

There is nothing wrong with crossposting, between alt and Big-8 or
otherwise, if it is considered that the material is sufficiently
appropriate for both groups.

Wikipedia is not a Usenet authority; Usenet has its own mechanisms.
Also, trustworthy authors have Web pages on the topic - see, for
example, signature line 2.

In particular, always check the authorship of Wikipedia articles, lest
they have been edited by well-known incompetents or kooks. In
particular, of course, Thomas Lahn himself.

It is, of course, bad manners to set a follow-up to a group which has
not received earlier articles in the thread.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top