First may I let you be aware that I am every bit as ignorant to
Javascript as domTT is a brilliant piece of software. Feel free to be
abusive if I have made any comedy blunders.
I have a technical area of a site which I want to have tooltips as a
gloassary for difficult terms, to improve readability without boring
those who already understand. I was looking for the functionality of
"Example 4 - click to stick" and the formatting and clean markup of
"Example 9 - clean up your markup".
I managed to link all of the relevant .js files in the header, whilst
also linking at the bottom of the <body> to an external .js with my
functions for the Behaviours dynamic updating of the id'd <a>'s and
<span>'s. I couldn't believe it when I got the thing to work, and it
looks brilliant, especially in FF.
The problem I have found, however, is if the the tooltip is further
down the page, once you have scrolled you can still click to stick -
but then clicking to drag the term makes the tooltip jump upwards as
if being reset to it's original relative positioning.
In desperation, I even deleted everything I had done and pasted in the
inline js code from Example 4 and it still did the same thing. Here
is a link to the offending page (which is very much under
construction!):
http://www.chartleycoffee.co.uk/star/gaz.html
The yellow highlighted "group heads" is the only tooltip on the page.
In IE6 it works perfectly without scrolling, but once you scroll the
dragging goes mental.
My javascript files are all in the their original state except my own
creation here:
http:www.chartleycoffee.co.uk/star/domTT/glossary.js
If anyone can help, I have nothing to offer except perhaps some free
coffee if you live in the UK. Otherwise my eternal gratitude!
I followed reems of functions calling functions (knowing nothing about
javascript/programming) untill I got to:
function domLib_getOffsets(in_object, in_preserveScroll)
{
if (typeof(in_preserveScroll) == 'undefined') {
in_preserveScroll = false;
}
Starting at line 434 of version 0.7.3 of the domLib.js script.
Changed it to 'true' and it did the trick. Seems to be working
correctly in both IE6 and FF2.0.0.3.
I hope this helps anyone else in the same predicament.
Good luck with further development of these tools, they're great.
Regards,
Owain
I love you man :)
Greets,
Maxwell