How do I simply hide a tooltip?
I have a image set as a link, with a title which is used for a caption in a lightbox. I need the "title" set in order to keep the caption for the lightbox, but开发者_运维技巧 I don't want the tool tip to pop up when I hover over the links. Anyone got a easy css fix? Or does this need to be done in Javascript?
What worked for me was to add a title to the 'img' tag within the 'a' tag, so that the 'a' has the full-text caption used by the lightbox plugin, for example title="This is a picture of...", but the 'img' tag has a shorter caption, for example title="The Beach".
That way the tooltip reveals "The Beach" rather than "This is a picture of...".
This can only be fixed in Javascript.
You can remove the tooltips like this:
$('...').removeAttr('title');
However, depending on your lightbox, you might not want to.
Which lightbox are you using?
When does it read the title
attributes?
Can it be configured to read a different attribute instead?
As far as I know the only way to disable the alt
tag text box is to code it as alt=""
and not put anything into them. The purpose is to help the impaired and or those who have images turned off. For those with readers, the reader looks for the alt tag and tells the user what that particular image is [based on what is in the tag]. Many website designers use those tags to describe the link, if that is what the image has, others put the ""
in if it is only an image.
EDIT:
The same should also work for the title
attribute. Play around with both of those and see if you can get the desired result.
精彩评论