• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Java or html code for word descriptions?

apu95

Caffeine-->Code Converter
#1
Hey guys...

My gf's website has lots of technical terms in it, and whenever one of those terms appear, she links it to a pop up window which contains the glossary of all words. In addition to this, we wanna add a mouseover code which shows the definition of the word. I tried the 'title= blabla' code within the hyperlink code, but the problem with this one is that it is rather small for some definitions, and I noticed that on Firefox, the descriptions aren't shown completely (when they're too long), while in IE they're shown completely.

While trying to look for another solution, I saw it on the OSNN mainpage. If you look at any of the headlines, say the "A Few Xbox 360 Impressions" story, some words are highlighted in green, and when you point at them a little box appears which shows sponsored links and stuff. I'm looking for exactly that, but of course instead of the sponsored link thing, we'd put the definition of the word instead.

Any ideas on how to get that? Or something very closely resembling that?

Thanks in advance,
Apu
 
#5
you could use the acronym tag i think it'll do what you want when you hover the mouse over the text it'll show the text in small box
Code:
<acronym title="Operating System News Network">OSNN</acronym>
or if you wanna do it with a definition
Code:
<acronym title="Definition of the word here">Word</acronym>
or you could use the 'title' attribute in a tag (ie: anchor tags, acronym tags....) and it'll display the text in a box but title by itself isn't a tag it's an attribute
 
Last edited:

apu95

Caffeine-->Code Converter
#6
Thanks for the replies guys :)

I actually did try both of those, but they only work in IE. For example, one word is "Gecko", so when I use the tag, I want the definition to be:

"any lizard of the family Gekkonidae. All geckos (except of the Eublepharinae subfamily, the true eyelid geckos) have immovable lens-like eyelids (brilles) and adhesive lamellae on the undersides of their toes that allow them to deftly climb most horizontal and vertical surfaces."

The problem with this is that it only works in IE. IE shows the full box with the whole definition, whereas Firefox shows a smaller box which encompasses the first 13 words, approximately.

Hope someone can find it :)
I'm gonna keep looking myself!

Thanks again!
Apu
 
#7
I was pondering about a vbs script to kick out a label on mouseover, and when I was searching I found this instead:

Code:
function initToolTips()
{  document.addEventListener('mouseover',constructToolTip,true);
   document.addEventListener('mouseout',deleteToolTip,true);
   document.addEventListener('mousemove',moveToolTip,true);
}

function constructToolTip(e)
{ var target=e.target;
    if(target.nodeName=='#text') target=target.parentNode;
    if(target.getAttribute('tooltip'))
      { if(tooltip) deleteToolTip(e);
        tooltip = document.createElement('DIV');
        document.body.appendChild(tooltip);
        tooltip.appendChild(
           document.createTextNode(target.getAttribute('tooltip')));
        setTimeout('displayToolTip()',ttDelay);
      }
}

function displayToolTip()
{ if(tooltip)
     { tooltip.style.display='block';
     }
}
Source and more code snipletts: http://www.vladdy.net/WebDesign/Tooltips.html

I'll still look for some vbs/xml scripts I have laying around from class, maybe one will work for you.
 

apu95

Caffeine-->Code Converter
#8
Thx so much for the reply Blue Jack :)
I'm not sure if it works or not though...I'm not very familiar on how to go about implementing it, even on a blank page. Mind if I ask for a bit of guidance?

Thanks again,
Apu
 
#9
I dug around that author's site, and he has a working downloadable eval: http://www.klproductions.com/kltooltips.html

I didn't know he was charging for the full code, sorry. You can check out everything from the eval package and see what he did. It comes with css and the js file.

Check out the download and use it as an example. There is an html page included with some great examples.
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,962
Messages
673,247
Members
89,017
Latest member
Seggar