PDA

View Full Version : Image w/ description tooltip



ipcress
04-11-2006, 08:27 AM
I've used the search function but I've been unable to find a solution .

Image w/ description tooltip

http://www.dynamicdrive.com/dynamici...agetooltip.htm

The script works perfectly for me , mouse over and picture / description appear ( position is currently set just below link )

var tipWidth= 160;
var offX= -80;
var offY= 40;

when the page is at the top , however .........

when the page is scrolled down , my tip box moves with it instead of always being below the link it then appear either above or if scrolled half way , right over the connecting link .

thanks in advance for any help .

jscheuer1
04-11-2006, 05:35 PM
Most likely, you have a DOCTYPE on your page, generally that is a good thing but, this script was written before the wide use of DOCTYPEs and so must be upgraded to work with them.

With many of the scripts of this type all that is required is to change all instances of:


document.body

to:


document.documentElement

But, in some older browsers, this will make problems so what can be done is to change all document.body references to:


iecompattest()

and put this function in the script block before any occurrences of iecompattest():


function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

Sometimes references to position and/or styled (not attributed) dimensions in the script must be made to use pixels but, this does not appear to be a problem in this script.

ipcress
04-14-2006, 03:52 PM
Many thanks for your help and your time .

I'll add in the new script this week-end to see if it works .

:)

ipcress
04-14-2006, 04:03 PM
Ah hell I could n't wait ...... works like a dream

ScarletBlue
01-01-2007, 04:56 AM
I registered just so I could say THANK YOU to John for posting the solution to this issue! It was driving me absolutely crazy, now it works perfectly. Thank you so much!!

Happy New Year!

Jess