Beeing very annoyed about the tooltip behaviour of firefox I searched for a solution without the Firefox add-in called "Long Titles", because probably only a few people of my audience (if any at all) will know about it.

Well, I found a CSS based solution which avoids the firefox 'title' problem.
I've done it only for the 'acronym link' because that was enogh for me but I think it might be worth to be a general option for glossary:
Please add an option to use either the title attribute or the span tag to include the text of glossary entry.

Here is what I've done:
I've changed the glossary.css

extended:
a.glossary-term
with: position: relative;

new:
a.glossary-term span
a.glossary-term:hover span

a.glossary-term {  position: relative;
  text-decoration: none;
  border-bottom: 1px dotted #080;
  color: #080;
  cursor: help;
}

a.glossary-term span {
    display: none;
}

a.glossary-term:hover span {
    position: absolute;
    top: 1px;
    left: 75px;
    width: 400px;
    display: block;
    text-decoration: none;
    color: black;
    background: #FDFFCF;
    border: 1px solid black;
}

I've also changed a bit of the glossary.module file:

In the function _glossary_filter_process($format, $text) I've replaced the handling of the case 'acronym link' with the following code:

   case 'acronym link':
       $ins_before = '<a class="glossary-term" href="'. url($linkto, null, null, $absolute_link) .'">';
       $ins_before .= '<span>'. check_plain($term_title) .'</span>';
       $ins_after = '</a>';
        break;

It works like a charm with Firefox and IE7.
An example is available at http://www.mobdata.de/Produkte/Handgeraete_fuer_die_mobile_Datenerfassung
Look for Schutzklasse and hover over it.

Comments

nancydru’s picture

Very interesting, thanks. I'll have to do more testing on the other formats.

Wolfflow’s picture

Title: Extend the replace modes with span tag » #2

subscribe

nancydru’s picture

Title: #2 » Extend the replace modes with span tag

Changed title back

AaronCollier’s picture

I don't know about the development of this issue, but the example isn't working for me now.

ikoch’s picture

I have removed the tooltips from my site and use links to the glossary terms because I've seen that the whole glossary entry is included in the html source of the page where tooltips are used.
I'm not sure about it but this *might* be considered as duplicate content by the search engines and I don't want to be punished for it. It's my business site.
Sorry for the inconvinience of the link not beeing available anymore.

gobinathm’s picture

Status: Active » Closed (outdated)

Closing the issue. It was inactive for long time & it's related to a Drupal Version which is not supported anymore