PROBLEM: I would like the title attribute of an <a> to display its contents on hover, but prevent anything from occurring upon clicking.
BACKGROUND: On the source page below I have many words that are highlighted with the <em>. Without any special effort on the part of the viewer these words appear with italics decoration. If the cursor is passed over these words, they are highlighted, and if the cursor is held some length of time the contents of the title attribute is displayed. If the viewer clicks on these words, however, the action ranges from nothing happening, to moving to the top of the page, to moving to the first <a> with a name attribute. My goal is to having nothing occur beyond the special hover effects.
I have tried all manner of approaches including a doNothing() {} JavaScript. Still, I cannot remove this erratic, unwanted behavior.
SOURCE IMAGE: http://www2.gol.com/users/hsmr/emblem/name.html
Murray *ACE* wrote: <a href="#" title="this is a title" onclick="return false">something else</a>
This achieved my goal well in both Safari and Opera. Unfortunately, Firefox, although not causing the page to move, does display a box with dotted lines indicating the portion of the text included in between the <a> tags. Is there someway to remove this effect, as well? Please find below by current HTML and CSS code.
HTML Code
<a href="#" onclick="return false" title="橋本龍太郎" class="Text_Translation"><em>Hashimoto Ryūtaro</em></a>
CSS Code
a.Text_Translation:link {
color:#FFF;
border-style:none;
}
a.Text_Translation:active {
border-style:none;
}
a.Text_Translation:visited {
text-decoration:none;
border-style:none;
}
kiusau wrote:
Unfortunately, Firefox, although not causing the page to move, does display a box with dotted lines indicating the portion of the text included in between the <a> tags. Is there someway to remove this effect, as well?
The focus rectangle (dotted lines) is required for keyboard navigation from button to button.
Nadia-P wrote: That's called a 'focus rectangle' and is important for people who don't use a pointing device for navigation.
The entry that you provided offered a script that was in error, but with some adjustment I was able to make it work. The correct script is given below:
CORRECT SCRIPT: onfocus="if(this.blur)this.blur()" placed directly in the <a> tag.
Or, alternatively, . . .
HEAD or BODY Tag:
<script type="text/javascript">
function onFocus() {
if (this.blur) {
this.blur();
}
</script.
ANCHOR Tag:
<a href="#" onclick="return false" onfocus="onFocus( )" title=". . . "> . . . </a>
See http://www2.gol.com/users/hsmr/emblem/name.html
Roddy ![]()
John Waller wrote: The focus rectangle (dotted lines) is required for keyboard navigation from button to button.
This particular function may be advantageous to those who rely on the keyboard, but it is misleading to those who do not. My goal is to display the contents of the title attribute in the absence of any indication of a link. Thanks to Nadia P's reference entry, I was able to solve this aspect of my dilemma. Now I must learn how to speed up the display, but this is the subject of another entry. See http://forums.adobe.com/message/1975326?tstart=0#1975326
Roddy ![]()
kiusau wrote:
<a href="#" onclick="return false" title="橋本龍太郎" class="Text_Translation"><em>Hashimoto Ryūtaro</em></a>
Why use a link for something that isn't a link?
<dfn><span class="Text_Translation">橋本龍太郎</span>Hashimoto Ryūtaro</dfn>And the CSS:
.Text_Translation {
font-style:normal;
display:none;
}
dfn {
position:relative;
}
dfn:hover span {
display:block;
position:absolute;
top:-20px;
left:20px;
background-color:#FF9;
padding:2px;
}
This is supported in all modern browsers, except IE6.
Murray *ACE* wrote:
I believe you can remove it entirely (thereby sacrificing usability for cosmetics) by using the style "outline:none;".
Projectseven has a free extension that 'scrubs' it... say it's for IE but may work... anyway, whatever scripty thingy Roddy is using is a disaster. The focus box remains and it minimizes my browser... (FF 3+)... i was quite zapped initially... had several windows open and it just pow! vanished...
Thought i'd post it but didn't want a whole harangue....
Added 'free' for obvious reasons :)
David_Powers wrote: Why use a link for something that isn't a link?
One good reason is that it produces mixed results. Depending on how I define the dfn:hover span {} rule the resulting display varies considerably from browser to browser and even item to item on the same page with the same browser. I have integrated your suggestion in the page that follows, so that you might visualize these vagaries yourself. Check it out, and please comment again.
In principle I like the idea of using the <dfn> tag, rather than the <a href="#"> tag. This is because I have more control over the appearance of what appears in the display boxes. Nevertheless, the display of the title attribute appears to be more robust across different browser and on the same page.
SOURCE PAGE: http://www2.gol.com/users/hsmr/emblem/name.html
Roddy ![]()
Murray *ACE* wrote: I believe you can remove it entirely (thereby sacrificing usability for cosmetics) by using the style "outline:none;".
For the moment I am focusing on the <dfn><span>SomeDefinition</span>DefinedItem</dfn> implementation suggested by David, as it provides greater design possibilities. Unfortunately, the display appears to be far less consistent across browsers and items on the same page. Please check it out and offer your comment and experimentation.
SOURCE PAGE: http://www2.gol.com/users/hsmr/emblem/name.html
Roddy ![]()
You still have this -
<img class="MojiFloat" src="../hashimori/iwa.gif" width="105px"
I believe your variation may be coming from this -
dfn:hover
Are you complete opposed to using something like this -
<dfn><a href="#" onclick="return false"><span class="Text_Translation">カタカナ</span></a>katakana</dfn> names
with the -
dfn a:hover { outline:none; }
rule? What inconsistencies are you seeing in the display, though?
Murray *ACE* wrote: You still have this -
<img class="MojiFloat" src="../hashimori/iwa.gif" width="105px"
The <img> tags are a completely different matter with which I am totally satisfied in Safari, Firefox, and Opera. No problem with any of these browsers. Have you found a problem with the display of these images in IE?
Thank you for pointing it out, but I am fairly convince that no browser cares. In any case, I have now removed the units.
Murray *ACE* wrote: I believe your variation may be coming from this -
dfn:hover
Most certainly, as this is what Murray recommended and what I used to obtain the effect using the <dfn> and <span> tags.
Murray *ACE* wrote: Are you complete opposed to using something like this -
<dfn><a href="#" onclick="return false"><span class="Text_Translation">カタカナ</span></a>katakana</dfn> names
with the -
dfn a:hover { outline:none; }
rule?
I am not opposed to anything -- completely or otherwise -- that works. Does this arrangement validate? Does it achieve anything besides the removal of the focus boxes. I realize that this was my original goal, but Murray's suggestion tempted me. I do not know, if you looked at my page prior to the changes, but the current display when it works is vastly more eye-catching than what can be achieved with the title attribute alone.
Murray *ACE* wrote: What inconsistencies are you seeing in the display, though?
Inconsistencies that I noted are the size, orientation, and position of the displayed boxes, the display of the highlighted word in the page itself, and visible overlap of a displayed box that obfuscates the text contained within upon hover. Specifically,
OPERA: Only two of the twelve displays created by the pairing of the <dfn> and <span> tags appear.
SAFARI: There is are no italics in Safari -- none. The aforementioned obfuscation is visible with the words Showa and Hirohito. (This is probably fixable with a tag-specific rule that changes the value of the zoom property. I have not tried it yet, as the other problems are far more serious and need to be resolved first.)
FIREFOX: The position of the displays is highly inconsistent from tag to tag.
Roddy ![]()
I am not opposed to anything -- completely or otherwise -- that works. Does this arrangement validate?
Definitely.
Does it achieve anything besides the removal of the focus boxes. I realize that this was my original goal, but Murray's suggestion tempted me.
Surely you mean David? But it achieves removal of the focus boxes (via the CSS), and it puts the :hover back onto an <a> tag which is the most widely supported location for it.
Inconsistencies that I noted are the size, orientation, and position of the displayed boxes, the display of the highlighted word in the page itself, and visible overlap of a displayed box that obfuscates the text contained within upon hover. Specifically,
OPERA: Only two of the twelve displays created by the pairing of the <dfn> and <span> tags appear.
SAFARI: There is are no italics in Safari -- none. The aforementioned obfuscation is visible with the words Showa and Hirohito. (This is probably fixable with a tag-specific rule that changes the value of the zoom property. I have not tried it yet, as the other problems are far more serious and need to be resolved first.)
FIREFOX: The position of the displays is highly inconsistent from tag to tag.
I saw no inconsistency in Firefox. Didn't check the others.
Murray *ACE* wrote: Surely you mean David? But it achieves removal of the focus boxes (via the CSS), and it puts the :hover back onto an <a> tag which is the most widely supported location for it.
Yes, I did mean David, and I apologize. Unfortunately, you and David do share one common negative trait that sometimes demands much patience on the part of the Asker -- you both tend to respond initially without fully understanding the problem. This is not meant to deride your eventual helpfulness, as I realize that you must respond to many askers at a given time.
It does make sense to place the pseudo class on the <a> tag, but lately -- not just here by the way -- I have learned that the :hover class enjoys a robust acceptance across HTML tags, even if this acceptance is not across all browsers. There is always this difficult trade-off.
Murray *ACE* wrote: I saw no inconsistency in Firefox. Didn't check the others.
Once again, Murray, there are twelve tags, and the relative position of what is displayed and the positions of the tags responsible for the display is wildly diverse as one moves from tag to tag down the page. Try all twelve and let me know, if you do not see the same. My version of Firefox is 3.0.10.
Thank you for helping to maintain a reasonable dialogue. Maybe David will pick-up where you have left off.
Roddy ![]()
kiusau wrote:
Unfortunately, you and David do share one common negative trait that sometimes demands much patience on the part of the Asker -- you both tend to respond initially without fully understanding the problem.
Perhaps the problem lies in the original question. I think you underestimate the degree of patience Murray and I exhibit. This is a user-to-user forum, not a free consultancy service. I point people in the direction of a potential solution to their problem. After that, the implementation is up to the individual.
Is this
David_Powers wrote: Perhaps the problem lies in the original question. I think you underestimate the degree of patience Murray and I exhibit. This is a user-to-user forum, not a free consultancy service. I point people in the direction of a potential solution to their problem. After that, the implementation is up to the individual.
your support for this
David_Powers wrote: This is supported in all modern browsers, except IE6.
SOURCE: http://forums.adobe.com/message/1977060#1977060
or your defense against this
kiusau wrote:This is not meant to deride your eventual helpfulness, as I realize that you must respond to many askers at a given time.
SOURCE: http://forums.adobe.com/message/1978410#1978410
For many this might be a good time to reflect about the differences between you and Murray, but as this is not the place for these kinds of discussions I will not pursue this matter further here. You are welcome to provide, on the other hand, your further input in regard to my poor implementation of your suggested fix that resulted in this:
kiusau wrote: Inconsistencies that I noted are the size, orientation, and position of the displayed boxes, the display of the highlighted word in the page itself, and visible overlap of a displayed box that obfuscates the text contained within upon hover. Specifically,
OPERA: Only two of the twelve displays created by the pairing of the <dfn> and <span> tags appear.
SAFARI: There is are no italics in Safari -- none. The aforementioned obfuscation is visible with the words Showa and Hirohito. (This is probably fixable with a tag-specific rule that changes the value of the zoom property. I have not tried it yet, as the other problems are far more serious and need to be resolved first.)
FIREFOX: The position of the displays is highly inconsistent from tag to tag.
SOURCE: http://forums.adobe.com/message/1978033#1978033
Roddy ![]()
David_Powers wrote: Perhaps the problem lies in the original question. I think you underestimate the degree of patience Murray and I exhibit. This is a user-to-user forum, not a free consultancy service. I point people in the direction of a potential solution to their problem. After that, the implementation is up to the individual.
Patience is a two-way street. Your role as a user in this forum I have yet to witness.
Roddy ![]()
[Ad hominem comments deleted by moderator]
Please find below both the source and implementation of a jQuery plug-in that helped me to overcome the unfortunate and erratic behavior associated with the use of the <dfn> and <span> tags suggested by David Powers.
IMPLEMENTATION: http://www2.gol.com/users/hsmr/emblem/name.html
SOURCE: http://docs.jquery.com/Plugins/Tooltip
Have a great Memorial Day weekend and don't forget our fallen soldiers!
[Link to irrelevant site deleted by moderator]
Roddy ![]()
kiusau wrote:
[deleted]
Please find below both the source and implementation of a jQuery plug-in that helped me to overcome the unfortunate and erratic behavior associated with the use of the <dfn> and <span> tags suggested by David Powers.
IMPLEMENTATION: http://www2.gol.com/users/hsmr/emblem/name.html
SOURCE: http://docs.jquery.com/Plugins/Tooltip
Have a great Memorial Day weekend and don't forget our fallen soldiers!
[deleted]
Roddy
[Personal insult removed by moderator] people try to help you then you castigate them because their help does not fit YOUR PARAMETERS. Please understand... this is not an Adobe Help Centre. This is a user-to-user forum. Which means, that as much as you are seeking help on a subject, David and Murray and all the rest could also be seeking help. The fact that they, or that anyone, tries to help you is something you should be grateful for. If you don't like the suggestion, shut up. Don't whine.
If you have found a solution to your problem elsewhere, by all means post it here for the benefit of others. But trying to rubbish those who've been trying to help you [personal abuse deleted], is just not on.
[deleted]
North America
Europe, Middle East and Africa
Asia Pacific