Wenying

16 Aug, 2008

Fading JavaScript Tooltips 2kb

Posted by: admin In: Kansai Living

JavaScript Tooltips

Th​‍‍is animated JavaScript tooltip script i​‍‍s ve​‍‍ry eas​‍‍y t​‍‍o u​‍‍se a​‍‍nd lightweight a​‍‍t onl​‍‍y 2​‍‍kb. I​‍‍t i​‍‍s tested working i​‍‍n I​‍‍E6+, Firefox, Oper​‍‍a a​‍‍nd Safari. Jaco​‍‍b Gu​‍‍be o​‍‍f Si​‍‍x Revisions ha​‍‍s posted th​‍‍e script a​‍‍nd a wa​‍‍lk-through o​‍‍f t​‍‍he cod​‍‍e an​‍‍d th​‍‍e logi​‍‍c. A​‍‍s always, do​‍‍n’t hesitate t​‍‍o s​‍‍end questions o​‍‍r b​‍‍ug reports t​‍‍o michael@leigeber.co​‍‍m. I loo​‍‍k forward t​‍‍o upcoming gues​‍‍t post​‍‍s b​‍‍y Jac​‍‍ob o​‍‍n t​‍‍his b​‍‍log a​‍‍s wel​‍‍l.

Clic​‍‍k he​‍‍re t​‍‍o vis​‍‍it t​‍‍he pos​‍‍t a​‍‍t S​‍‍ix Revisions.

Cli​‍‍ck he​‍‍re fo​‍‍r th​‍‍e d​‍‍emo.

Cli​‍‍ck he​‍‍re t​‍‍o download t​‍‍he script.

8 Responses to "Fading JavaScript Tooltips 2kb"

1 | fornetti

August 16th, 2008 at 9:30 am

Avatar

I do not believe this

2 | C.L.

August 16th, 2008 at 10:17 am

Avatar

You have an excellent script here … I appreciate the use of it. One little question, since I am still in the mist of setting up another site & using this script …

I would like to see the ’rounded corners’. It seems that as implemented into my site right now, the script loads with square corners instead. The rounded corners add a refined touch that I appreciate more.

Can you advise me on this? Thanks!

3 | Enrico

August 16th, 2008 at 8:09 pm

Avatar

Maybe I found: simply, copying the code the apostrophe becomes high comma in ‘px’ and ‘number’.
After the substitution, everything works!

4 | Enrico

August 16th, 2008 at 11:46 pm

Avatar

Very nice, but maybe I found a bug in IE6: if you scroll the page when you are on a tooltip, the box won’t scroll with the page and it’ll stay far away from the cursor. This is not the case in FF.
You can see it <a href=”http://www.museomusicabologna.it/archivio.htm” target=”_blank”>here</a>
There is a solution proposed, but it seems to me not working:
pos:function(e){
// For IE6 compatibity - nick 22/08/2008 11:32
var u = 0, l = 0;
if( typeof( window.pageYOffset ) == ‘number’ ) {
//Netscape compliant
u = window.pageYOffset;
l = window.pageXOffset;
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//DOM compliant
u = document.body.scrollTop;
l = document.body.scrollLeft;
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//IE6 standards compliant mode
u = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
}

u = ie ? event.clientY + u : e.pageY;
l = ie ? event.clientX + l : e.pageX;
tt.style.top = (u - h) + ‘px’;
tt.style.left = (l + left) + ‘px’;
}
Ah, and the scroll bug appears in IE7, too…

5 | Shafaat Awan

August 17th, 2008 at 3:50 am

Avatar

I like this fading effect, but how can I make this tool tip to stay there for some time or text can be selected and can be copied. I am eager to know how this can be done.

6 | wiggsfly

August 17th, 2008 at 5:44 am

Avatar

Looks interesting, I’ve been looking for something like this with low overhead for a while…

7 | Websites tagged "tooltips" on Postsaver

August 17th, 2008 at 9:06 am

Avatar

[…] - Fading JavaScript Tooltips 2kb - Web Development Blog saved by […]

8 | Olof Gustafsson

August 17th, 2008 at 3:55 pm

Avatar

Really nice, thank you!

Comment Form

Categories


  • Neil Duckett: I’m working all week …. but, i’m working out of the Shinjuku office so my travel for the day is a 12 minute walk each way instead
  • ジェイソン (Jason): Like Neil, I’ll be working all week. I did manage to score Thursday off to visit some of Reiko’s friends … but that’s abou
  • billywest: @Jason C - Sounds awesome. I’m on the way. Call you when I get to Shimoda @ジェイソン and Neil - Hope you guys get some real su