PDA

View Full Version : Cool DHTML Tooltip II help



Joe Donohue
01-09-2005, 06:11 PM
Script: Cool DHTML Tooltip II

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm

I am having a problem making this nice tooltip script work in IE 6.0.

It works fine when the page is first opened, but if you scroll the page a few lines, the tooltip does not track the link. Instead, it appears to track relative to the window. It works correctly in Netscape 6.

The style statement "left: -300px;" does not have any effect in IE but the other style statements (width, border, etc) all function properly. It appears that the DIV container is not being properly set in IE.

Here is a link to the problem page:
chairsTEST.htm (http://acorn.he.net/~rotaryc/RYLA/chairsTEST.htm)

The style declarations begin on line 13
The javascript functions are on lines 59-156
The ordered list with links begin on line 161.

I would appreciate any help on this.

Joe Donohue

ddadmin
01-11-2005, 02:11 AM
Hmmm the tooltop continues to be positioned properly even if I scroll the page so the last link appears near the top of the page onMouseover. Please describe the problem in more detail.

BTW, it's fine to put our script in an external .js file, though the credit notice must still stay intact within the document's visible source, per our rules: http://www.dynamicdrive.com/notice.htm (under New).

Joe Donohue
01-11-2005, 03:19 PM
Well, I had finally given up and replaced the function with wz_tooltip, which is what you saw last evening. It works fine but I like the arrow shape on Cool DHTML Tooltip II.

I restored the chairs.htm file at the original link if you want to look at it.
http://acorn.he.net/~rotaryc/RYLA/chairsTEST.htm

I put the javascript into a .js file on line 59. (Same problem).
The unordered list of links begins on line 63.

Joe Donohue

ddadmin
01-13-2005, 10:56 AM
Well, it seems if you put the script that supposed to go in the body inline on the page (instead of in a .js file as you currently have), the tooltip positions itself correctly. Please try that for now then.

FPit
01-13-2005, 11:53 AM
Funny thing is that if you save it locally, it works without problem. I save HTML code from "view source" and saves JS file locally by directly requesting it, and it works without a problem...

Joe Donohue
01-14-2005, 04:59 PM
Actually, I had it that way, but on 1/10 you said "BTW, it's fine to put our script in an external .js file, ...."

Of course I tried both ways and it behaves the same. I put it (the javascript) back inline and uploaded it. Same behavior.

FPit commented that "if the file is saved locally it works without a problem." That got me thinking in another direction. When you do that the CSS (RYLA1.css)file is not included.

I believe the problem is the style sheet is interacting poorly with the style declarations in ToolTip II.

The stylesheet has the declaration:td {font-size:1em; position:relative; top:25;}. The #dhtmltooltip declaration says {position:absolute; left: -300px;

It looks like the inline declaration does not override the "position:relative" statement in the style sheet - in IE 6, that is. It does in netscape 7.

In any case, I got around the problem by creating a different CSS file for this page without the "position" statement. Also, it works fine in a .js file.

Thank you both for the help.

ddadmin
01-20-2005, 12:07 AM
Can this script work on snitz forum?

There's no reason it can't, since Snitz still outputs plain HTML, and DHTML works with any HTML. :)