with Imagination: by Dustin Diaz

./with Imagination

A JavaScript, CSS, XHTML web log focusing on usability and accessibility by Dustin Diaz

JavaScript Fading Tooltips

Tuesday, August 30th, 2005

Introducing: Sweet Titles

No. It’s not a knock-off from NICE Titles nor is it trying to improve on Dunstan’s revised attempt. And it most definitely isn’t ripped from one of those event-handler infested scripts from Dynamic Drive

No. It’s none of those. Instead I had two goals for this script.

  1. Make the code cleaner and much more condense - with in fact - less code
  2. Improve the tooltip effect

Download Sweet Titles 1.0

download sweet titles

I feel I have achieved both and for what I would call innovating the wheel. To see a working demo just hover over any link on this website and you will be enlightened with Sweet Titles.

What’s the big deal?

Well, for starters as I mentioned the code is “a lot” less than the original scripts by Stuart and Dunstan. However this is no way saying what they did wasn’t great. In fact, it was freakin’ awesome! Also needless to say I was in JavaScript diapers when they did it. I’m not going to compare code length because that would just be stupid and I don’t want to turn this into a contest.

Second, it has the cool fade in effect just like the Clagnut photo fades demo. I did, however, take out the support for Safari, although it would only add on another two lines of code. No biggie. The Fade effect does work in safari.

Tooltip Usability

One other thing to note on the difference between Sweet Titles and Nice Titles is that I cut off the URI at 25 characters for the main reason of unwanted lengthiness. My main concern is that all I really need to know is the originating domain and on average, that’s what you’ll find in the first 25 characters.

No, there were no studies on how long the typical domain is or what users prefer to see. It was merely an educated guess that I figured was appropriate. If anyone has information otherwise, please let me know.

Another cool notable feature that Sweet Titles (as well as Nice Titles) has is that the JavaScript is unobtrusive which of course as we all know, in and of itself, improves accessibility.

How do I implement this on ‘my’ website

Please Note: The Following instructions have been deprecated

Simple enough. Just follow these steps:

  1. Download the toolTipLib.js file and add it into the head of your document. Eg: <script type="text/javascript" xsrc="http://example.com/js/toolTipLib.js" mce_src="http://example.com/js/toolTipLib.js"></script>
  2. add these few functions to your js file. They include Scott Andrew’s addEvent() function and other useful functions that grab Event sources, attach window events, and take advantage of event flushing to take into account for IE’s memory leak. To make it simple you can just download the file and append it to your document the same way you did with the toolTipLib.js file or keep them separate the way I have them (preferred)
  3. Add the following CSS to your style sheet:

    toolTip.css

    /* Fading Tooltips */
    div#toolTip {
    position:absolute;
    width:220px;
    background:#000;
    border:2px double #fff;
    text-align:left;
    padding:5px;
    -moz-border-radius:5px;
    z-index:1000;
    }
    div#toolTip p {
    margin:0;
    padding:0;
    color:#fff;
    font:11px/12px verdana,arial,serif;
    }
    div#toolTip p em {
    display:block;
    margin-top:3px;
    color:#f60;
    font-style:normal;
    font-weight:bold;
    }
  4. Style the CSS as needed to fit your likings but be careful with the positioning (keep it absolute). And please, by all means, don’t make them look like mine. Be creative! That’s what this is all about anyway.

Why is the CSS separate from the JavaScript?

Because it should be. I believe keep the ‘look’ of the tooltip should be defined by CSS in your style sheet and not JavaScript writing out CSS. In a way it gives the developer more control and it is easier (for you) to maintain.

Why is the JavaScript in three (two) separate files!

Because keeping functions grouped separately is also what I advocate. Simply adding the event attachment functions to the toolTipLib just isn’t practical when I’m going to be using them several other places throughout my site.

If you like, you can put them all in one file if it’s that big of a deal. I’m fully aware I could have made this more plug ‘n play from the beginning, but this was a concious decision I’ve made on how I implement libraries. In the same manner that OpenRico extends the ProtoType library, we should all be doing similar techniques.

Enjoy Your Titles!

186 Responses to “JavaScript Fading Tooltips”

  1. James Mitchell

    Dustin - - this rocks! I am already trying to figure a way to work it into my sites.

    I have to agree with you on the need to keep the CSS seperate, as you stated: “it should be.” Far too often developers hide the ‘variables’ and unless you know where they can sometimes be more difficult to change. Thanks again this will be a nice addition to put in my designer toolbelt.

  2. Justin P.

    That’s cool Dustin, works nice and smooth for me on Firefox.

    Does this automatically pick-up all anchors or do you specificy a certain class for it?

  3. Dustin Diaz

    @James
    Thanks for the boost of encouragement. Also, expect another post on “Keeping CSS Separate from JavaScript”. This will take a big chunk out of the “D” in DHTML. Typically, dHTML involves some combonation of manipulating the presentation layer with JavaScript yet we often tend to include this presentation manipulation in the behavior layer.

    @Justin
    Yes. It picks up all anchors. If you truly want it to be as flexible as Dunstan’s - then you’d simply attach the same event/function combo to all <abbr />, <ins />, and <del /> elements. If you look at the Tooltip library file you’ll notice it’s a very simple getElementsByTagName() method being called. :)

  4. Justin P.

    Looks like there’s some issues with IE (random, totally not helpful Javascript error), possibly related to the attribute accessor methods (getAttribute, setAttribute, removeAttribute, etc..).

    Hey Mr. Wheel inventor, have you given a look to the Scriptaculous library? Lots of handy visual effects that can be applied to elements (cross browser compatible).

  5. Tony

    Great. I wonder if it would be possible to apply the fade to a pure CSS tooltip also:

    http://www.communitymx.com/content/article.cfm?cid=4E2C0

    best wishes

    Tony

  6. Jim (JAAulde)

    Dustin,

    Nicely done! You’re quite the client-sdie master! I imagine I may use this myself on my own site (once I get it re-developed).

    I don’t get the before mentioned error in IE, but I do notice that in Opera it works well, but Opera displays the HREF attribute in it’s own title-looking-display-box which sits on top of yours and hides it. No big deal to me, but I know your picky so I thought I’d let you know. :)

    Jim

  7. James Mitchell

    Dustin - - No problem, I am actually showing this to a few buddies too, as they would love this on their sites.

    Justin - - I see it too, I think it has to do with the tooltip positioning in the CSS. The tooltips are appearing just not in the viewable area. If you scrolldown and don’t see a tooltip it appears the position is higher on the screen. I bet it is a matter of doing the all familiar !important type tweak for IE.

  8. Dustin Diaz

    @Justin:
    I might just have to look into setting the element.title to equal ” (empty string). Thanks for the small catch. Also, I might just have to take a look at the scriptiliciouis library. There’s always things that can be made better.

    @Tony
    Yes. The fading technique can be applied to it, but then it wouldn’t be a Pure CSS solution anymore…not to mention that this method stands alone on its own merit for the fact that it grabs your title attribtue and not some hidden span element. Needless to say, it doesn’t require ‘html hacking’. The CSS Tooltip also stands on it’s own for the fact that it works with just CSS. The worst thing that could happen on this end is that if someone has JavaScript turned off, they’ll still see the titles. :)
    Choose one that suites you best.

    @Jim:
    I definitely want to check this out. Now that Opera 8.0 has fixed many DOM short-comings I’m willing to look into a fix for it. Any suggestions ;) (Hey, I know you’re quite the DOM master too)

    @James:
    Oh My! That’s what I get when I don’t test throroughly in a browser. I didn’t even think to scroll down the page further. This must be the way IE interprest the x,y cords. As you can see here:

    var x = (window.Event) ? e.pageX : event.clientX;
    var y = (window.Event) ? e.pageY : event.clientY;

    Is that now how this is supposed to work? I’m getting the feeling that this original is very beta-ish.
    I’ll get a better working version before not too long. Plus I’ll add in the fade effect back into Safari.

  9. Justin P

    Hey Dustin, just an idea I got from looking at the pure-CSS article Tony linked up.

    Modify your Javascript to read all the titles of links and write out a span inside the anchro to facilitate the pure-CSS solution. That way the markup does not need to be modified but at the same time you can have very lean Javascript because all it does is read anchor’s titles and write them into a new child span. No need to bother with monitoring mouseover/mouseout events and collecting problematic X/Y coordinates.

    Just a thought :)

  10. Dustin Diaz

    There is a small issue with the CSS solution. It requires that you set your links with a relative position. Although I was thinking of doing something similar before I got started, in the end I didn’t want to change any existing styles. also, the span element is not as robust as the div. Even when you apply display:block IE generally treats it a bit buggy when applying borders. However, you could still (with JavaScript) change the span to a div…and yes, this would solve the x/y issue.
    Hmmm…

  11. Jason Beaird

    Hey Dustin, this is looking great so far! What was the reason for disabling it in Safari though?

  12. Justin P

    Dustin know lika da Mac (just kidding Dustin)

  13. Justin P

    Know as in no, just to let you know.

  14. Dustin Diaz

    To address Jason, it should technically already be working with your latest version of Safari. What I originally meant to say is that it won’t work on legacy versions of Safari. See Cross Browser Transparency

  15. Justin P

    That is really lame that you’ve got to use three different properties just to get transparency working in 3 browsers, at the same time that just shows the awesomeness of Safari that they support (yet another) CSS3 rule.

  16. Andy Beeching

    Dustin, lovely script! I can see this one spreading all over the place by non-scripters such as myself (Really need to get into DOM!). Just a query. Would it be possible to run this script to only pick up anchors in a certain place on the page?

    For example just in a div with an id e.g #right? Or how about just in the tag where any links I would want the effect would go?

    I just don’t want this effect on a menu or other elements I’ve already styled.

    How bout if you already have an attribute for external links for validation, such as rel=”external”. I’d imagine this script most useful for external resources, as internal ones would just flash up the same domain as the URI, so would it be possible to just target them?

    Many thanks for your work, big fan! Keep it up! :)

  17. Dustin Diaz

    Andy, the answer to all your questions is yes. Of course it would take some modifications, and that’s where knowing how to manipulate the DOM would be beneficial. I figure what I’ve done is make it work ‘out of the box’ for a very generic solution. The script seems to address what ‘everyone’ might want. As for yourself, if you want to target a specific area, you could change the line of code


    var links = document.getElementsByTagName('a');

    to this:

    var sideBar = document.getElementById('right');
    var links = sideBar.getElementsByTagName('a');

    If that’s to restrictive, then you can use my getElementsByClass() function to specifically target all the links you want, and then target those individual classes.
    Eg.


    <a class="tooltip" href="#">Link with Tooltip</a>
    <a href="#">Link without Tooltip</a>

    You get the idea?
    If you wanted to target the external links you would just append this inside the for() loop:
    if ( links[i].getAttribute('rel') == 'external' ) {

    As you can see, the original script is still very flexible to modify. :D

  18. Andy Beeching

    Dustin your my hero! :) Thanks very muchly, I’m awaiting this book: http://domscripting.com/ to get into it.. I understand what’s going on, just was never any good at writing it!

    Thanks for your work, and the tips! I’ll be sure to post my site when I get this implemented! :)

  19. Andy Beeching

    Just as an update, I’ve been playing around with this. I find that it works perfectly in any compliant browser, but that the results are a little haphazard in IE (surprise! ;) )

    Therefore, since I don’t want tooltips appearing on the other side of the screen to where the link is, I’ve disabled support for it in IE, by way of a simple display:none in the CSS. Is there a better javascript way, that means only non-IE browsers apply this JS? Have you had any luck tweaking the CSS and making IE play nice?

    Extra cool stuff for this script would be the ability to have diiferent styles pop up for different types of link… e.g. one set of styles for external links, and one set for internal.

    I also found the fade in timer for IE was a little slow, so increased the increments of applied opacity to 20, and the final opacity to 90. Guess that’s a moot point now though!

  20. Dustin Diaz

    Andy, I commend you for taking it upon yourself to add your own modifications :D. Many just make requests and expect another release. This tells me that I have achieved one of my intentions of allowing any developer to simply manipulate the script without much work.

    On the deal with IE. I am still planning on implementing a fix for it. The method will alter slightly in the fact that I will grab the offsetLeft and offsetTop properties of the element in question as opposed to clientX and clientY. It might add a couple lines of code, but in the process, it will be cutting back a few too.

    To implement ‘external’ vs ‘internal’ - just off the top of my head - append varying className properties depending on the rel attribute. Or, you could do a string match on the domain by simply hard coding your domain:
    var domain = /^example.com$/;
    if ( domain.match(location.href) ) {
    links[i].className += ' internal';
    }

    … or something to that effect.

    On the opacity factor, be sure you don’t go past .9. Not for visual reasons, but because Firefox will cause a flicker once it reaches 1.0 at the end of the ‘fade-in’ effect. This was a verified and known issue among several developers.

  21. Andy Beeching

    Thanks for that Dustin! I decided not to implement the alternative styles for my site, but will definitely keep it in mind for future endevours! Thanks once again for taking the time out to answer my questions, and I look forward to a release with improved support for that bane of web developers, IE!

    :)

    P.S. I demonstrated the effect to a bunch of beta testers on one portal type site, and they loved it. Made for that extra user-friendly touch, so thanks!

  22. MitchellGallery.us » Fading Tooltips using CSS and Javascript

    […] so everyone can benefit. It is available free to the public for use. View Dustin’s Fading JavaScript Tooltip and let me know what you think ! Update: there might be a quick workaround fi […]

  23. Daniel E. Renfer

    Dustin,

    I implemented this on my site yesterday and it’s working great. I did have a little bit of trouble getting it to load in the first place, but after I re-wrote the onload handler, it worked great.

    You might want to check this out. PPK ran a contest to see who could re-code the cross-browser addEvent() function. I dropped in #5, (seemed to be the best) and your code still works fine. This resolves the problem of only being able to attach one event to a given handler.

    I need to get in the habit of putting title attributes on all of my links now.

    Also, is there a way to disable this script if the parent element has a title supplied. I’m sure I could figure it out if I thought about it, just wondering if you had any thoughts.

  24. Dustin Diaz

    You want to disable parent elements like <abbr /> as if there were a link it in? Off hand, yes, I’m sure you can…

    If you were having issues with the onload… that was just a silly function I was using to avoid conflicts with other onloads. I’m thinking about just taking it out…

    Thus, to implement the correct fix, just do this:

    Change this (toolTipLib.js):
    addLoadEvent(toolTipLib.attachToolTipBehavior);

    To this:
    addEvent(window,’load’,toolTipLib.attachToolTipBehavior,false);

    need to get in the habit of putting title attributes on all of my links now.

    Yea, it ‘does’ sort of get you in the habit of doing that. Once folks find that you have cool looking toolTip’s on your site they’re going to expect title’s in each and everyone. Also, funny thing you mention it because I had to go through my whole site and put titles in all the more important links that I thought folks would click on. All in all, it should be a best practice for accessibility reasons.

  25. Andy Beeching

    Dustin, this is really excellent! I have implemented this on a test website and it works like a charm! I like the fact that it goes by link position now, as no matter where the mousover occurs now, the box always appears in the same position! The last version meant that the boxes would often appear at different positions around the link. Even works in IE 5.x, nice!

    Kudos!

  26. Ryan Thrash

    Very cool in FF, but it’s not working at all in the latest Safari for me. I’d love to otherwise use this on all sites.

    Any ideas why?

  27. brandon e

    You might want to check out Squidfingers version of these tooltips. Much simpler but doesn’t have the fade in.

    http://www.squidfingers.com/code/dhtml/?id=tooltips

  28. David

    This isnt working for me. I’ve been sitting here for about an hour trying to figure out why. It’s probably something simple. Can someone check out this page?
    http://designofdavidross.com

    Thanks,
    David

  29. schey

    Andy Beeching, could you post a link to your test site. I am having problems making it work… thanks!

  30. Dustin Diaz

    @Andy:
    Thanks for the reference on someone else using it. It’s nice to know people are actually implementing it.

    @Ryan:
    Unfortunately I didn’t have Safari available to test on. I made sure I’ve done the best I can on using simple DOM 0-2 without going into any proprietary components of separate BOM’s (browser object model’s). Would you mind telling me what error you’re getting? Also, have you tried implementing the small fix with addLoadEvent in comment #24? Any other testers that wouldn’t mind looking into that issues? I’d like to get this working on at least the major desktop browsers…

    @Brandon:
    I’m not sure how much ’simpler’ it can be. Several folks here have this working on their site. I could in fact make it more plug ‘n play but I chose to keep things separate where they belong which involves a minor learning curve. Plus, the filesize of the toolTipLib.js file is around 1.8k… which isn’t bad at all. After looking at the other script, it’s about the same size. Some other tiffs with the other is that when I mouseover a link, my scrollbar moves up and down in IE6.
    However all that aside, I mentioned before that there is probably already a thousand scripts that do something similar… but I mentioned my goals for this one in the article. If you like those goals as well, then this ‘be’ the one for you.

    @David:
    Many apologies. Please read the update that occurred Sept 15. You’re missing the element finder functions in findPosXY.js.

    @Schey:
    Did you miss the update too? I’ll update the original instructions.

  31. davidbisset.com » JavaScript Fading Tooltips

    […]

    davidbisset.com

    JavaScript Fading Tooltips An “improvement” on previous tooltips with some CSS and Javascript… very, very nice.
    […]

  32. pauly

    I like it a lot, cheers… I’d like to see the http://www stripped out of the beginning of the popup url, to save a bit more space. Implementing it myself, just thought I’d tip you off. Thanks again.

  33. pauly

    Oh and I’d like to see “internal” links not show the URL too. Using this on http://www.folkestonegerald.com too. Cheers again!

  34. Andy Beeching

    Dustin, I’m in love whith this script! Just one thing I came across which relates to an earlier comment I made. I have an XHTML strict site, and used an unobtrusive javascript from sitepoint to open links with rel=”external” in a new window. Couple this with your script which only applies to these links, and the sitepoint script won’t work anymore, plus the tooltips disappear.

    Here’s the script: http://www.sitepoint.com/article/standards-compliant-world/3

  35. Stuart (diff guy)

    Would you mind posting how you captured the location to snap to the link? Pretty please?

  36. Dustin Diaz

    @All
    To make any ammendments you’ll probably have to look into making your own modifications. At this point I’m only making updates that will improve the bullet-proofness. It needs to be a ‘one-size-fits-all’ script.

    If you’re looking into doing external links you can do a simple check either on the target or a className…

    var links = document.getElementsByTagName('a');
    for ( i=0; i<links .length; i++ ) {
    if ( links[i].target == '_blank' || links[i].className == 'external' ) // continue
    }

    not to mention, you could do the same with internal.

    If you want to change the amount of characters that are shown in the href property, change the number ‘25′ to whatever you like on line 37. if you don’t want to see the http:// change the substring to say substr(6,25) (note difference on substring vs substr).

    Good luck folks :)

  37. Joe

    Just wanted to let you know that this script breaks if the contents of the link is an image (or in general anything other than text). I’ve put up a simple test case on my site demonstrating this bug:

    http://tantannoodles.com/code/sweet-titles/test-case.html

    I came across this issue because I have some thumbnail images, and I wanted to use your fading tooltip script on them.

    For some reason, it seems that the object being passed into toolTipLib.tipShow is the child object, and not the anchor tag object. But this doesn’t make sense to me, since the tipShow() is only attatched to the mouseover event of the anchor tag… not it’s children.

    I have a feeling this has to do with event bubbles… I’ll let you know if I can figgure out a fix.

  38. Dustin Diaz

    Joe,
    Thanks for this catch. Yes, that is wierd and needs to be addressed as true bug and not an enhancement or feature. I’ll look into it and hopefully have a fix very soon.

    One bug that I found that if you alert the anchor object you get the ‘href’ property and not HTMLLinkElement or HTMLAnchorElement. What doesn’t make sense is that ‘that’ is the default behavior in almost all major browsers. (Gecko, IE, Opera, Safari). But it’s wrong, right? At the least I should see [object] like any other element. For some reason browser makers have concluded that an anchor object is it’s href attribute which I think is incorrect. Anyway, that’s another topic.

    Thanks again Joe for pointing this out.

  39. Dustin Diaz

    Joe, I fixed the bug you mentioned. Many thanks. One of which was worthy to call for a second update. Please see above in the article body for the appropriate changes.

  40. Dustin Diaz

    To all:
    On the issues of Opera. Opera 7.2- will choke. I will in fact make an assumption that Opera users live on the edge and frequently update as often as possible. Thus on Opera 8.x+ the script is working just as intended minus the fact that Opera still throws in its own toolTips on top of these one’s. Very annoying if I was an Opera user. Aside from it, I’m not going to figure out how to fix it. After viewing it myself in the newest version 8.5 - it really wasn’t all that bad.

  41. pauly

    Just FYI, here’s what I did with the code

    // could mix the next 3 lines into one, but leaving for clarity
    var h = obj.href.toString();
    var dPos = h.indexOf(’http://www.’);
    h = ( dPos == 0 ? h.substring(11,h.length) : h ); // hard coded for efficiency

    // now back to the original code!
    var addy = ( h.length > 35 ? h.toString().substring(0,35)+”…” : h );

    I’ve noticed something else along the lines of Andy’s experience above, I had a script already that ran through the links on a page inserting a “target=_new” if it was an external link etc, to get the functionality while keeping the code standards compliant (well mostly). This also inserted title tags where they were missing - this aren’t picked up by the sweet titles code though. Investigating myself, but wondered if anyone else had this. Code is all in place on http://www.clarkeology.com/blog/

  42. Colin

    This script is great, thanks! But is there any way to adjust it so that the tooltip only appears over links that have title/alt tags?

    For example, go to http://www.colinmckinney.co.uk/test and look at my comment links etc

  43. Stuart (diff guy)

    Any chance of seeing how you snapped to the link in a fixed position?

  44. Stuart (diff guy)

    nm, I read the code, :-)

  45. Dustin Diaz

    @paulie
    I suppose the simplest thing would have just been to update the substr(7,25) (accounting for http://). They both work though. The potential problem I still see is linking off to ‘https’ websites.

    @Colin
    Take a look at the code. It’s fairly straight forward. Follow each method that jumps to another.

    On the tipOver method simply check if there is a title attribute.

    if ( !obj.getAttribute('title') ) return;

    @Stuart.
    Thanks for diving in and checking it out!

  46. Andy Beeching

    Dustin, thanks for the IE fix, works very nicely now! :)

  47. Take My Advice - I’m Not Using It! » Around the Web

    […] w. Since most of you are currently looking for employment, you may want to take a look. JavaScript Fading Tooltips - CSS and JavaScript to create hyperlink mouseover tooltips. Pretty slick! D […]

  48. Dustin Diaz

    Hey folks, check out what Pauly has done with it. Nice work. And thanks for doing your own modifications :D
    Paulys toolTipLib.js file.

  49. pauly

    Cheers Dustin, I’ve learned a few things from this

  50. cg

    hey love what u’ve done but I have a question. How would i make the tooltip pop up and display the title’s embedded in EM tags but with a different css style than is used for A tags?

  51. yurivish

    1 question.

    First off, thanks a lot, the tooltips are great! But I have noticed, even on your site, the tooltips with no message just have ‘null’ as the text… is there a way to check for that and remove it, leaving just the URL?

  52. pauly

    I’m spotting the “Null” thing too, on links that are wrapped around images only… did I miss an update?

  53. pauly

    I did miss something. As you were!

  54. Dustin Diaz

    Thanks Pauly. if you do notice anything extremely quirky, please let me know.

  55. Kim Steinhaug

    Great script Dustin!

    Is there a way to make this work only for images with the alt tag instead? Meaning images without a link, but with alt tag, (Or images with title tag would make it more crossbrowser since Firefox doesnt display ALT).

    I hoped I could only alter the :
    var links = document.getElementsByTagName(’a');

    to

    var links = document.getElementsByTagName(’img’);

    But it was not that simple, :D

    Again, great script!

  56. Dustin Diaz

    Hi Kim,
    as you may have noticed, this is sweet “titles” and not sweet “alts” ;)

    The goal was to replace titles since the correct behavior is to show a toolTip. To show a toolTip for alt attributes would be incorrect. IE actually gets it wrong in this case.

    If you take a look at the script you’ll see that it does in fact replace title attributes with tip attributes.

    Put up a test case URL and let everyone have a look.

  57. Kim Steinhaug

    Thanks for the reply Dustin, ill post a URL for you. I almost got it to work, that is - I got it to work in IE with images but it looks like Firefox won’t attach the onmouse events on the img element, proabably since its incorrect. In IE I also have to “erase” the ALT tag if I use the tootip, since as you mention IE has this wrong and will tooltip that aswell which results in two wonderful tooltips at once, :D

    My main purpose for altering this fine script was to include more beautiful tooltips on images inside an admin system. For instance there are various alert lamps which lights from green to red and they have some explernation why in their title - however they are not links. I could wrap an a element around with a href=”#” but to me that looks abit over the top, since we are talking about having the markup as clean as possible, :D

    I’ll play around some more, and post my findings shortly. Again, great script - normally I would use it just the way it is, but sometimes it’s so darn funny to tweak them just a little bit… As if we had all the time in the world for things like this, :D

  58. Kim Steinhaug

    After some puddling around I seemed to get it together, :D

    http://kim.steinhaug.no/files/toolTipLib.js

    Its true as you mentioned, this was supposed to be “sweet titles”, it still is except that its now “sweet image titles”, :D

    Just switch this file with the one you have, the modifications are as follows :

    * events are only added to images which has a title, lets refer to theese as tt-img (as in tool tip image)
    * tt-img are stripped from title, to prevent firefox from displaying tooltip, and alt is stripped, to prevent IE to display tooltip.
    * if a tt-img is wrapped with a link (a element) which cointains a title, the title is just for safety removed so we dont get any double tooltips.

    Atleast this serves my purpose nicely, which is :
    Giving a more visible tooltip to graphical icons which doesnt neccersarily are links.

    Hope tihs can be of any use to other people, :D

  59. Dustin Diaz

    Kim,
    keep in mind that the comment in your file that says “I don’t see any use for this?”… everything in that file is there for a reason. One of the main goals was to make the script as short and quick loading as possible. If something doesn’t belong, then I wouldn’t have put it in.

    The part you commented out will in the case of links will take care of the ‘wrong node’ problem. However since images can’t have childNodes (like links) you’d be better off just deleting the code rather than commenting it out. Just be sure that if you ever decide to implement the link titles back in to put that snippet back in.

    You also have other area’s where you don’t see any “real” use for the particular sets of code… keep in mind other people will be looking at this as part of ‘My’ base code. I’d encourage you to at the least just remove the comments or change them to say something more appropriate like “Modification to suite image titles”

    The uses were fairly obvious before the modifications so please take into account all those things.

    On a more positive note, good handy work and taking the responsibility to modify it for your own needs. I commend those who don’t expect a free helping hand.

  60. Kim Steinhaug

    You are absolutely right Dustin, the comments was mainly for myself comparing against the original code for links. I updated the file from the link above so no of the comments are in it any longer, :D

    I really love the seperation of javascript in this script, you are probably familiar with the slayeroffice.org site, found a great way of doing nice checkboxes aswell :
    http://slayeroffice.com/?c=/content/code/custom_checkbox.html

    This is definitely the right way of doing things, clean and beautiful markup without trace of javascript - and for those not using javascript it still works the way its supposed to. Both are great examples I think.

  61. markus

    hi,

    thanks for this nice tooltip classes! can I add your code to a GPL’ed CGI of mine?

    markus

  62. Dustin Diaz

    markus,
    Under the creative common lisence stated in the files. Yes, you may.

  63. Jonathan Buchanan

    Thanks for the superb script, Dustin.

    As I use the Prototype framework so much, I’ve done a quick and simple port which uses Prototype methods in place of the methods in the extra .js files you supply:

    http://insin.woaf.net/code/javascript/prototip.html

  64. Dustin Diaz

    Hey Jonathan,
    very nice. And great use of integration with Prototype. It shows the power of Prototype as a framework for plug’n play. Also thanks for the credits on your ProtoTip page. Well done.

  65. David

    Hi,
    I’m just starting on a new personal website and was hopefully going to implement Dustin’s Sweet Titles into the site. But, I’ve run across a problem.

    Have a look at:
    http://designofdavidross.com/

    If you scroll the text box down and hover over one of the test links you’ll see that the title displays much farther down the page than the actual link. I don’t know javascript well enough to figure out what’s going on or how to fix it. Does anyone here have any ideas?

    There are some other problems I’ve encontered as well dealing with the sIFR in Safari so I may just abandon this design all together and go with a normal site that enlarges as content is added but if I can overcome these problems I’d like to stick with this design.

    Thanks for any info, greatly appreciated,
    David

  66. Robert

    Hey Dustin, it looks great, i’m improving the js and i think it’s a nice ‘toque’ (touch) But i’ve got a problem… i wanna use it only in some links, not the whole page. Any suggestions?

    thx

  67. Dustin Diaz

    Hi Robert,
    Please look at the comments, that issue was discussed :)

  68. Robert

    I changed document.getElementsByTagName(’a'); to document.getElementsByTagName(’x'); and also the a in the web page, but it didn’t work.

    btw, Sorry but i read the posts and i didn’t get how to apply the getElementsByClass() function.

    Hope you can guide me.

  69. yurivish

    In toolTipLib, I changed the loop up top to include an if to test whether or not a link has a title attribute, to rid yourself of the ‘null’ popups. :)

    for ( i=0;i

  70. yurivish

    Seems my previous comment was cut off:

    if(links[i].title != “”){

    That’s what I added.

  71. Robert

    Yurivish, Dustin Diaz (common spanish last name, cool).
    finally… ITs working! HA! first of all, i read something about JavaScript Functions, i know about asp and dot.net, and i decided to learn JS since 10′. Then i read the toolTipLib code, i undestood it and voilá! Thanks, thanks a lot.

    Now i need to improve somthing new, i now i can use asp to validate vars, but i’m using js even for submit the form:

    if (sub){document.promocion.submit();}

    with firefox the submit works, but with windows xp sp2 doesnt. It’s a security problem, i know… but dunno the solution. I know also this is about Sweet-titles, so any Response.redirect to a new post would be appreciated.

    Again, thanks a lot.

  72. Tyler Kovacs

    Dustin,

    Thank you so much for the use of your tooltip library. I’ve struggled with the shortcomings of three other tooltip libraries before finding yours. I had to hack it a little to make it work in my environment, but all the hacking in the world wasn’t helping the other libraries. Plus yours is smaller!

    As of 3am tonight (the next time I’ll be able to do a code push to our production servers) you’ll be able to see your tooltips in action on http://www.zvents.com.

    Thanks again!

    Tyler

  73. Listal development » List improvements!

    […] (which also saves) -I’ve updated the grid view and added tooltips based on the code available here -I’ve also added tags as a drop down. Permalink […]

  74. Michael Warf

    Thanks for all your hard work on this one Dustin, we just implemented it on our homepage as a test (we really miss the use of flash on our homepage - but are trying to keep within a little more “web-standardy” look & feel at the moment).

    Nice Work!

  75. Travis

    I’m trying this out as a tooltip for images, but I’m having a big problem in IE. If you’re moused over where the tooltip is going to show up, it just flashes and disappears. In Firefox it appears and then any mouse movement causes it to hide.

    I know this is due to the browser firing the onmouseout event, but I haven’t figured out what to do about it. Unfortunately I can’t just forget about IE…this is the cleanest tooltip script I’ve seen. I’d rather make it work than go with something else.

    Anyone else having this problem? Ideas?

  76. Dustin Diaz

    Travis, I would still like to get this script to work with my original intentions of having the toolTip appear by mouse position and not element position. If anyone has found a good source for finding position x,y coordinates to the page that works in both IE and Firefox and in standards mode, let me know. The best source I found so far only worked in quirksMode found at Dynamic Drive. Of course the second you throw in a doctype, your mouse ‘page’ cordinates get nuked in Internet Explorer.

    What I might possibly do to the script is add ‘official’ support for images which will attach a completely different method calculating image height into the toolTip position… these are just a few of my ideas ;)

  77. Obadiah

    ey dustin im a huge fan of this script…my only question(well actually a bunch of questions) im looking to use this in my own site….i have downloaded the js files but im having trouble making it work….is there any way possible that you can send me or show me step by step code for this method…i would really appreiciate it…thanx mann

  78. Dustin Diaz

    Hi Obadiah,
    Please read the post. It explains exactly what one needs to do. :) Several others have got it working without much difficulty. Good Luck.

  79. David

    I get this error from the CSS validator:

    # Line: 132 Context : body div#toolTip

    Parse Error - -moz-border-radius: 1em 1em 1em 1em;

    What options do I have when trying to correct this error?

    Thanks

  80. Dustin Diaz

    david,
    just take it out. I was using them as proprietary browser styles for mozilla. ( you know, so it looks good :) )

  81. WebtoYou-Magazin

    Fading Tooltips mit Java Script

    In der Statuszeile des Browsers wird wird angezeigt wie die URL eines Links ist. Die Tolltipps des Browsers zeigen dazu beim berfahren den Alt-Text. Eigendlich hat man so alles Infos die man dringend braucht. Wenn nicht ein aber wre …
    Ersteinm…

  82. David

    Dustin,
    I know but I like the rounded corners. With IE specific styles I just place an ie.css style sheet in a conditional comment but I don’t know of a way to set up a separate stylesheet for Firefox only.
    Too bad it’s proprietary and not just part of the css spec and there’d be no problem!

  83. Robert

    Obadiah, if you and Dustin don’t mind, I could help you. Or ill try. So, shoot dude. or contact me rrosset@gmail.com

    If Dustin says no, don’t contact me.

  84. Dustin Diaz

    Hey, I’m all for other members of the community helping others :). Have at it and help a brother (or sister) out.

  85. TeamSuperGood » JS Links of the Day

    […] so much so easy, including AJAX. See nice tutorial. And finaly, don’t we all want Fading Tooltips?

    Lea […]

  86. Dima

    Thanks for the script! I’ve changed it so it is more functional now - you can see an example on RSS button (top right) and tag links on items here.

  87. torresburriel.com » Lecturas sobre hojas de estilo y estndares web - 19/10/05

    […] k to Top" links Wired redesign turns 3 CSS color chart Jeremy Keith interview JavaScript Fading Tooltips Collaborative Tagging November 3, 2005 is World Usability Day (WUD) Deci […]

  88. Pig Pen » JavaScript Fading Tooltips - its an adventure

    […] under: Programming — nortypig @ 3:45 pm JavaScript Fading Tooltips by Dunstin Diaz. […]

  89. L. Robinson

    Thanks so much for a great (lean) script! The fade effect is very nice.

    For those having trouble giving it a go, the solution may be as simple as rearranging the order of the script calls in the header. If you’re keeping them in separate files, make sure the event handlers come first. I wouldn’t know the difference, meself, but it worked. :)

  90. Dustin Diaz

    Robinson,
    You are in fact correct. That could possibly confuse someone who is following the instructions verbatum. However from this point out I think everyone is just downloading the main zip file which allows you to plug away with something that already works.

    Thanks for the look out though :)

  91. sunny

    nice. really.
    only problem for me is not with script, but with viewing this page. when i hover over the little images on the right, i only see about 1cm of the left side of the tooltip and a horizontal scrollbar appears. of course, if i go down to scroll, the tooltip disappears :)
    pretty major usability issue here, me thinks.

  92. Dustin Diaz

    sunny,
    I think that’s been my main issue as well. I am possibly going to release an ammendment to this script that will check the document width and fix the positioning accordingly. It just happened to be that nobody mentioned anything so I was putting that off for as long as possible.

  93. JC Sebastian

    Dustin, maybe this is what are you looking for? Make sure you examine carefully this part. I hope that will resolve your problems with findposXY, I don’t have the time to make my way through it (not today and not in a few days I mean).

    Keep up the good work!

  94. Dustin Diaz

    Sebastian, I’m already running something similar to that. What I really want is a mouse position finder - not an element finder. If anyone finds a good one, please let me know. Also thanks for the encouragement :)

  95. Toni Ivanisevic

    hi, cool script!!

    i missed 2 things
    (1) dont display links/tooltip if no title-tag is there
    (2) show the accesskeys in the tooltip
    so i put some lines in the part, where you cruse thru the a-tags and create a css-class called (.aKey) to set the style for the accesskeys

    for ( i=0; i AccessKey [' + links[i].getAttribute('accesskey') +']'; // add accesskey-string
    }
    links[i].setAttribute('tip', toolTipTmpTitle);
    links[i].removeAttribute('title');
    }
    }

    hope it helps someone

  96. Brian Ernesto

    Here is a little fix for the DOCTYPE strict body.scrollTop issue you described. IN IE 6 strict and transitional DOCTYPES the BODY and HTML elements do not have a predefined height as they do in quirks mode. Therefore they do not fire an onscroll event and do not have a scroll top. By applying a little CSS the issue is quickly resolved.

    HTML{overflow:hidden}
    BODY{height:100%; margin:0; overflow:auto}

    Brian Ernesto

  97. Dustin Diaz

    Hey Brian,
    You showed up just a couple hours late. The work around was in fact adding document.documentElement and not document.body :)

    By my oh my, what a brain buster it’s been.

  98. Kevin Steba

    Great script! Im planning to use it in my new project, thanks allot!

    @ Toni Ivanisevic, could you please tell me where i have to add your code? Just like you i don’t want to show the tipTool if there isn’t a title-tag. I hope you can help me out with this one.

    Thanks for all the great thinking !

    Kevin Steba

  99. Dustin Diaz

    if ( element[j].getAttribute(’title’) == null ) { continue; }

  100. Robert

    I see in the last few comments some javascript code that, if used, makes these sweet titles appear only when there is a title. But, I don’t know javascript at all and I dont know where to put the code in the file. Can someone explain in a way a 10 year old would understand? LOL.

    Thanks

  101. Artemis

    I saw your email about this script come through in the WSG group and got pretty excited hehe. I have been looking for something like this for ages, but had no idea it existed. I managed to get a background for it added in the css (still learning css)… very cool!

    Thank you ever so much for offering this… I can’t wait to tell the ladies about it in the WordPress Learning Buddies yahoo group!!

  102. The Mainbrace » Sweet titles

    […]

    The Mainbrace

    blog

    Sweet titlesin the wee hours

    http://www.dustindiaz.com/sweet-titles/ Just like overlib but with a GREAT fade in. Also will automatic […]

  103. Dave

    Thanks for this script. May I suggest next time you preserve the spacing in the css file for easy modifications. I’m scratching my head at why you crunched the code…It doesn’t save that much space.

  104. Dustin Diaz

    Dave,
    that is the normal way I write CSS. It’s method I prefer over elongated markup. Each rule gets a line… it really isn’t all that hard to understand.

    And on the contrary, it does lots of space…especially when your style sheets get over 10k

  105. Kelly Sigethy

    The web is built on great free scripts just like this one. This is an awesome script and its smart to keep everything separate, even if others do not realise how smart this is. Its clean, its graphical eye candy and its easy to install. I will keep watch over your site and your future designs. Good work!

  106. Dustin Diaz

    Thanks Kelly for the boost of encouragment. I’m glad it was easy for you to get working quickly.

  107. Aninda

    Hi,

    this is just superb. Great. :-)
    Can i use this code in my site? :-)
    I was also looking at the code.
    What do i do if i dont want the tool tip to come on certain links ?

    Regards
    AB

  108. Dustin Diaz

    Aninda, you may surely use this on your site. It is for all to benefit. As for the toolTip not showing up on certain links feature, it has been discussed by a few during the course of the comments. I’m afraid you’ll just have to take a gander at some of them.

  109. Aninda

    Thank a lot for letting me use this code.
    Sorry about asking this again. I am totally lost in that code i have no idea about how to edit it and make it happen. Actually i am a designer and know javascript very little just trying to learn. So it will be a great help if you can explain this in a more simplistic way :-) or if you have a that code ready with you.. you send me please. :-)

    Thanks

  110. Daniel

    Hmmm, well I feel weird. I tried for about a half-hour to implement it. Damn! I can only assume my existing style sheet messed it up? Or .js file?

    D

  111. Dustin Diaz

    Daniel,
    this shouldn’t be too difficult to get going. The styles are very uniquely named so they wouldn’t conflict.

    Did you follow the instructions in the download file?
    Be sure to add functionAddEvent.js first in your list of files to include.

    Once that’s in, you can plugin the toolTipLib.js file. Lastly don’t forget to import the toolTip.css file or just plugin those styles into an existing style sheet.

  112. Daniel

    Maybe there is a certain way that you have to place the div, p, and em tags around links?

    looking at your code, and javascript programming in general, does not seem to care if my .js folder home is named /scripts etc.

    I would get variations. Sometimes just like a multi layerd back-ground. Other times I would hover over the link get it nice and made and the link would disappear onmouseout

  113. Daniel

    You are a good programmer btw. Are you implementing Xlinks?

  114. Juglar :: Personalizar los elementos “title” :: February :: 2005

    […] vad los ejemplos: uno y dos. Descarga de los archivos para esta versión. Más: HoverHelp JavaScript Fading Tooltips Ref: torresburriel.com

    « Anterior: Technorati
    Sigui […]

  115. greg

    im currently using the rico library to add ajax functionality to my developmental site. the problem i run into is that while the script works for links directly specified on the page,

    but when i use js to replace innerHTML, the script doesnt pick up the a tags and fire the tooltip. any ideas?

  116. ctran

    It’d be nice to adjust the position of the tooltip based on the visible view of the element, like when I’m at the bottom of the page, it’d be nice to show the tooltip above the element instead of below (like Netflix)

  117. Dustin Diaz

    Ctran,
    You must be still using an old copy of this script. update and get the newest. The toolTip does in fact stay above the page for links near the bottom. Try it out on this page with the links at the footer.

  118. EepP

    The read-me file of Sweet Titles is corrupted

    This is what you tell us to add to our script, but it doesn’t correpond to what is in the example source, because to link a script in the JS directory, we do not put a slash before it in the link.

    It took me a while to find this and a non programmer or non html understander could reject this script because of that little error.

    Be aware.

    – EepP

  119. Dustin Diaz

    @EepP,

    It took me a while to find this and a non programmer or non html understander could reject this script because of that little error.

    I’ve downloaded the file from this very page and the readme looks perfectly ok. Albeit I haven’t tested the readme on a mac. I figured .txt would work perfectly fine.

    As for non-html folk…I suppose I wouldn’t have expected someone to even get this far if they didn’t know html. I’m sorry if this caused any troubles.

  120. Mahesh babu.R

    Is it possible to add images to the tool tip? :)

  121. Geert Leyseele

    The read-me is just fine on a Mac.

  122. Clark

    There are problems with your script when there is flash on the same page when viewing with Firefox 1.5 on a Mac. It causes the embedded flash to disappear. Otherwise works well.

  123. Josh

    Awesome script. I spent most of the day trying to get my own working then found this, which is nicer, but has the same problem I was trying to fix in mine. If I scroll the page in IE, the tooltips don’t get positioned correctly; they are always at the top of the page. Is there an IE fix for this script? I found another script that has good positioning but it’s written so…cryptically…I haven’t been able to decypher it yet to merge. Also, is there a way to make it follow the pointer currently?

    Thanks!

  124. Dustin Diaz

    @Josh:
    Yes, the fix is to use a doctype ;)
    I assumed more advanced developers would find the script…which assume you practice developing with Web Standards.

    Simply add doctype and your browser should jump into “Standards Compliant Mode” and treat the script correctly :)

  125. Tin

    hi, is it possible to have the width of the box vary depending on the length of the title? thanks.

  126. Dustin Diaz

    Tin, the width in this case is used to determine whether or not it will fly off the screen. Thus 200px seemed like perfect number. Plus really long widths can deter readability…especially if you have an entire paragraph on one line.

  127. Charle

    Very nice website, Dustin - and of course this solution is awesome =)

    I was wondering about 1 thing:

    Is it possible to remove the opacity to use an image for the background instead - or at least have a totally black background? I’d like to try both to find out what looks best on our website, you see. Opacity ruins it in this case [grins].

    Keep up the good work!

    -Charle

  128. Boofer

    First off nice tooltips. I do see a problem though in IE. For those who use that browser, the tooltip is being stuck underneath the select boxes making the tooltip unreadable. I don’t believe there is a z-index fix, I think you have to hide the select boxes for the momment that the tooltip is visible.

  129. Charle

    I saw others asking for exactly how to make this work for links with titles only, and not for those without - so here is where in the toolTipLib.js the code must change:

    Find line 19, on new line add

    if (current[j].getAttribute('title') != null &&
    current[j].getAttribute('title') != '') {

    Find line 26 (previously line 25 if you added the above to code to a new line), on new line add

    }

    This solution was given to me by Toni Ivanisevic whom I contacted via email due to the fact that I sucketh at javascript and I’d like to help those who share my intelligumence ^^

    Dustin already answered how to do this, but us n00bs generally don’t understand a single line of c0d3, and far from what to do with it.

    Enjoy folks - it’s a really cool creation.

    Thank you, Dustin and Toni!

    -Charle

  130. Andrew

    Hi!
    Any chance we could get this working with image maps? Doesn’t seem to work right now…

    Thanks,

    Andrew

  131. Charle

    You might get it working by doing these code changes in the toolTipLib.js, it’ll allow titles working for the area property in image maps. I got it working on our site: http://alventyr.net/maps.php

    In the top part of the javascript, where it says something like
    tipElements : [’a',’abbr’,'acronym’, ……
    you can add ‘area’ in there as well.

    Next, find where the code says something like
    if ( trueObj.nodeName.toLowerCase() == ‘a’ || trueObj.nodeName.toLowerCase() == ‘acronym’ || trueObj.nodeName.toLowerCase() == ‘abbr’ ||
    and just copy the part that says
    || trueObj.nodeName.toLowerCase() == 'abbr'
    and paste it, then change ‘abbr’ to ‘area’.

    That should do it, methinks.

    Charle

  132. Tony

    Hi Charlie

    I have been trying to implement your modification to the code so that if a link does not have a title, there is no tooltip. I particularly wanted this, because I have removed the visible URL at the end of the tooltips, and a blank empty tooltip looks silly!

    I have copied the code you have on your site. But when I test it on my hard-disk, it only works if there is title=”" in my link. If I remove that completely, the page seems not to complete loading in FF. You see the green bar continue. Its like the javascript is looking for something, and won’t allow things to finish loading if it is not there.

    I see the same thing happening if I add the element ‘form’ to the script (so that I can display a tooltip within a form) and then do not have a form element on that page, the loading hangs, and the tooltips don’t work. When there is a form element on the page, it works fine.

    Best wishes

    Tony

  133. Charle

    Hey Tony

    I’m sorry I can’t be of any more help than what I’ve written here. JavaScript isn’t my thing… The css code that displays the url, I changed that to display: none; and that’s the only thing I can think of that’d be different from our codes. Since my links are working fine when not using title at all I suggest you double and tripple check your js O_o

    Good luck, man - and merry x-mas!

    Charle

  134. Szu-c

    Hi.

    I liked the script and used it, but there is a little “bug” in it.
    With Opera the tooltip can slip offscreen. With IE and Firefox it works fine.

    Tnx.

    Szu-c

  135. The weblog of Jonatan Olofsson » Introducing: “cuteTitles”

    […] lled one of my friends from Christian-Web-Masters.com’s project: Dustin Diaz’s Sweet Titles. So then i decided to write my own equivalent - somewhat improved of course (like i could m […]

  136. Enter The Dog at Aadil.mu

    […] r people on that day before. :) Anyway, some changes were brought to this blog. Firstly, cool transparent tooltips were added to the ma […]

  137. Max Design - standards based web design, development and training » Blog Archive » Some links for light reading (20/10/05)

    […] Back to Top” links Wired redesign turns 3 CSS color chart Jeremy Keith interview JavaScript Fading Tooltips Collaborative Tagging November 3, 2005 is World Usability Day (WUD) Decisio […]

  138. [ nothing is static ] » Email cleanup

    […] kickass tutorial by Dustin Diaz on how to make fading javascript elements. Check it out [Dustin Diaz] Bring on the Ruby onslaught! A nice collection of Ruby resources [Loudthinking.com - Gettin […]

  139. Andy

    Hello,

    I’m having difficulties setting up “sweet titles” on my webpage. I followed the instructions exactly, however nothing seems to happen. Is there something else I need to do that wasn’t already mentioned? If it helps, I’m using Dreamweaver to build my website and I have been previewing it in Firefox. Any help you can offer would be greatly appreciated.

    -Andy

  140. khakis web » JavaScript Fading Tooltips

    […] vaScript Fading Tooltips
    Posted in Design by mheidzir on the January 4th, 2006

    An “improvement” on previous tooltips with some CSS and Javascript… very, very nice.

    […]

  141. Tony

    I still love the tooltips, and have them implemented with a small ‘i’ graphic background, and a second outer border bottom and right, to emulate a drop shadow. I’d like to find a way to add a third border, so that the grey shadow could be two-tone, and therefore more like a shadow.

    best wishes

    tony

  142. Dan

    Excellent script Dustin and thanks for your help and additions Tony! Has anyone discovered a way to put a line break in the middle of tooltip text?

  143. When do users disable JavaScript?

    […] not always degradable. For example, looking back at my JavaScript fading tooltips known as Sweet Titles - albeit the code is unobtrusive, but the degradability is in fact an […]

  144. Wordpress Theme Binary Blue | 4null4.de - Blog around the world

    […] v0.9.3 exchanged “nice titles” script with a slightly modified version of a smarter solution by Dustin Diaz added full scheme switcher support, based on Dustin Diaz&# […]

  145. Sweet Bubbles?

    […] position until you mouseout of your element that fired the tooltip. When I was developing Sweet Titles I was keeping these two main things in mind. But one thing […]

  146. Sweet Titles Finalized

    […] eans, get Sweet Titles today! Download Sweet Titles: Version 1.0 Final Also see when the Sweet Titles launch article for history. The original article is outdated, but i […]

  147. ChamPioNeer^千片泥

    […] 20;nice titles” script with a slightly modified version of a smarter solution by Dustin Diaz (http://www.dustindiaz.com/sweet-titles) + added full scheme switcher support, based on Dustin Diaz’ absolutely GREAT ‘Unobtrusive Degradab […]

  148. Nogz Blogz :: Sweet Titles Test Page ::February ::2006

    […]
    February 3rd, 2006

    Sweet Titles Test Page
    Filed under: Cool

    This is a Test of Sweet Titles

    | Add to Del.icio. […]

  149. btd » Blog Archive » takie bajerki

    […] ciki robiące tooltipy i przy komentarzach pokazujące przeglądarkę i system piszącego. http://www.dustindiaz.com/sweet-titles - skrypt sweet-titles http://priyadi.net/archives/2005/03/29/wordpr […]

  150. LukeLabern.com

    […] zwozhere] Trackmania Nations from [Matt Brett] note: you need to check out this free game! Sweet Tiles from [Dustin Diaz] idGettr from [eightface] AtariBoy […]

  151. Final Mistakes for Sweet Titles

    […] I promise, this will be my last post ever on for what seemed to have been something very cool in the beginning, has turned out to get the best of me. Yea, I’m talking about Sweet Titles. […]

  152. Do Not Spam dot org / Liberaltopia has a new design

    […] Integrated modified version of Dustin Diaz’ Sweet Titles […]

  153. yauidea.com » 網誌 20060328

    […] http://www.dustindiaz.com/sweet-titles  […]

  154. Episode 05: The State of JavaScript

    […] Also there’s a new toolTip in town called qTip. Appropriately named. We quickly moved onto something otherwise known as Sweet Titles which Dustin nonchalantly progressed to. […]

  155. DarrenHoyt.com » Blog Archive » Sweet Titles, with Options, All in One File

    […] For anyone interested, I’ve taken Dustin Diaz’s handy Sweet Titles script, condensed all the relevant code into one document and tweaked it so that only anchor tags with the “title” attribute will display a rollover while the others display as normal. Feel free to grab it here. […]

  156. Mohamed Ibrahim » Image fades and Sweet Titles

    […] I recently changed my Word Press blog theme from Quentin to Antique old. The new theme has an excellent look, and it had some cool fading titles. I researched the code, and found that those titles are from a library called Sweet Titles. That library provides very nice effects on the titles of anchors and images. […]

  157. Vitamin Features » 15 Things you can do with Yahoo! UI

    […] Here we have an OO version of Sweet Titles that allows us to declare multiple instances of tooltips on separate elements with some optional configuration parameters you can pass into the constructor object to get that exact look and feel you want out of a tooltip. See Demo […]

  158. some improvement… at Eric Tan’s weBlog

    […] After the little complaint from scorpy in my guestbook, I also improve the links page, by introducing sweet title script to my blog. So what does this sweet title does? Basically it will shows a beautifully design black box with link name and title as below, when you hover on any link in my blog. I still have to re-adjust this sweet title to blend it nicely to my blog, please give me some time. […]

  159. Tool Tip Java script - what`s the better at Web Thoughts

    […] i remember Sweet title , Nice title , Tooltip , BoxOver .. […]

  160. CMilfont » Yahoo! UI Library

    […] http://www.thinkvitamin.com/misc/yui-demos/demo-04.html http://www.thinkvitamin.com/misc/yui-demos/demo-06.htmlhttp://www.thinkvitamin.com/misc/yui-demos/demo-09.html http://www.dustindiaz.com/sweet-titles/ […]

  161. Pimp ur Links at Maveriksworld.de

    […] Kein wirkliches Plugin, aber dennoch eine Erweiterung für jedes Wordpress-Theme stellen die Sweet Titles von Dustin Diaz dar. Dabei wird mein Mouseover über einen Link eine Art ToolTip eingeblendet. Dieser ist dazu noch frei konfigurierbar, was Farbe, Schriftart etc. angeht. […]

  162. thefaviconshow.com - Webforumz.com (Web Design Forums)

    […] Thanks, I’m using Sweet Titles, you can check it here. Two sites added! __________________ The Favicon Show […]

  163. Sugar Arrays: Porting over JavaScript 1.6 Array methods

    […] If you’re developing for todays grade A browsers, then you can count on being able to extend Array through it’s prototype. But, since I have a natural love toward things that are sweet, I’ve already done it for you with sugar and spice. […]

  164. Furuskog.se » Blog Archive » Sweet titles

    […] I´m proud to present “Sweet titles” on my site. […]

  165. Lars-Schenk.com » Smarter SweetTitles - JavaScript Fading Tooltips adjusted

    […] Dustin Diaz hat mit SweetTitles eine sehr elegante Lösung zur verbesserten Darstellung von Tooltips erstellt. Ich habe das JavaScript jetzt mal probeweise auch auf dieser Site eingesetzt und dabei noch mal ein klein wenig an meine Bedürfnisse angepasst. […]

  166. Max Design - standards based web design, development and training » Some links for light reading (20/10/05)

    […] JavaScript Fading Tooltips […]

  167. SSDD Web Design » Article » Javascript Technique

    […] JavaScript Fading Tooltips […]

  168. Popup Infobox funktioniert nicht - XHTMLforum

    […] document.getElementById("object1").style.left = x + 15 + "px"; document.getElementById("object1").style.top = y - 5 + "px"; Aber wie gesagt, das Script ist konzeptionell vllig veraltet. Eine Alternative ist z.B. JavaScript Fading Tooltips Du solltest durchaus den standardkonformen Modus anschalten, indem du einen vollen DOCTYPE verwendest. So erreichst du, dass die Browser deinen Code gem den Standards interpretieren, das erleichtert dir die Entwicklung. […]

  169. Beta » Sweet Titles

    […] “Sweet Titles” supporting article […]

  170. WS ToolTips auf Webwork Studios

    […] WS ToolTips 9. Januar 2007 .download { clear: both; padding: 5px 10px 5px 70px; background-image: url(http://www.webwork-studios.de/wp-content/themes/webwork_studios/images/download.png); background-position: 2px 50%; background-repeat: no-repeat; background-color: #D9DFF0; border: 1px solid #ccc; font-size: 0.8em; line-height: 1.4em; color: #666; height: 85px; } Ich finde das Script ‘Sweet Titles‘ von Dustin Diaz ziemlich cool und benutze es auch sehr gern. Nun, da ich vor kurzem den WS PicViewer veröffentlicht habe, dachte ich mir, ein weiteres cooles Script in mein WP einzubauen. Das PlugIn biete ich hier nun zum Download an. […]

  171. WP - Bubble Tooltips (Plugin) | bueltge.de [by:ltge.de]

    […] Seit Version 2.0 kann zwischen zwei verschiedenen Arten von Tooltips gewächselt werden, dazu muss eine kleine Änderung im Plugin erfolgen. Das Script Sweet Title dazu stammt von Dustin Diaz und ich habe es nur ins Plugin integriert, da der Wunsch von einigen lesern kam. […]

  172. Better tooltips… | Solitude is my only comfort…

    […] I’m currently working on better tool tips than Sweet Titles written by Dustin Diaz of Yahoo! fame. Dustin’s implementation embedded a hidden element that would be positioned absolutely and displayed at run time with the title text from the target element.  It also creates a tip attribute on the target element and moves the content of the title attribute to the newly created tip element.  I like these ideas and will likely borrow them.  I like Dustin’s implementation as a proof of concept but it doesn’t perform so well (in my experience) on IE, which unfortunately constitutes a fair proportion of our client browser usage, and indeed the world, so its back to the drawing board. […]

  173. Wordpress Plugin: Ironie Tagger | nicht ganz ernstl | XSBlog2.0beta

    […] Für die Anzeige der Tooltips verwende ich im übrigen eine durch mich leicht modifizierte Version von Sweet Titles von Dustin Diaz (liegt auch im Original dem Plugin bei). […]

  174. Tutorials Round-Up: Ajax, CSS, JavaScript, PHP, MySQL and More | Smashing Magazine

    […] JavaScript Fading Tooltips Sweet Titles 1.0, Documentation, JavaScript Files, CSS File […]

  175. WordPress theme: Greenery « iLEMONed

    […] Sweet Titles […]

  176. advance car cash loan title

    advance car cash loan title…

    JavaScript Fading Tooltips…

  177. How-Tos and Tutorials for Ajax, CSS, Flash, Javascript, PHP, Mysql, RSS, XML at IdiotFriendly.com

    […] JavaScript Fading Tooltips Sweet Titles 1.0, Documentation, JavaScript Files, CSS File […]

  178. JohnBedard.com » JavaScript Fading Tooltips

    […] JavaScript Fading Tooltips posted by John at 9:25 am   […]

  179. Tooltips verbessern (Sweet Titles) | funkygog Blog

    […] Zur Darstellung von Tooltips benutze ich Sweet Titles. Es handelt hierbei um eine Java-Script Datei die man in sein Blog-Theme (oder auch Webseite) einbinden kann. […]

  180. BoBo1664’s BLoG » Thème Wordpress : HemingwayEx

    […] Sweet Titles : permettant l’affichage des bulles d’aide […]

  181. Pixelco Blog » Blog Archive » Tutoriales/Recursos

    […] JavaScript Fading Tooltips […]

  182. BoBo1664’s BLoG » Blog Archive » Thème Wordpress : HemingwayEx

    […] Sweet Titles : permettant l’affichage des bulles d’aide […]

  183. morgenlandfahrt.net | Das Weblog von Markus Sowada » Blog Archive » WP-Plugins: BubbleTooltips

    […] BubbleTooltips von Frank Bültge Frank hat dieses Plugin, wie er selber sagt, einfach mit ein wenig JavaScript und Cascading Stylesheets realisiert. Dabei wird JavaScript für die eigentliche (technische) Umsetzung genutzt und den Stylesheets kommt die Aufgabe zu, die Bubbles optisch an das jeweilige Design des eigenen Blogs anzupassen. Ab Version 2.0 seiner BubbleTooltips kann man sich sogar aussuchen, ob die Bubbles auf herkömmliche Art daher kommen sollen oder ob man stattdessen lieber die sogenannten ‘Sweet Titles’ verwenden mag. Letzere hat Frank einfach nur in sein Plugin integriert. Die ‘Sweet Titles’ stammen ursprünglich von Dunstan Diaz. Mehr Erklärungen und die genaue Anweisung zur Einbindung des Plugins findet ihr direkt auf den Seiten von Frank Bültge. Tags: SocialMedia, Web 2.0, WordPress. FaveThis? Diese Icons verzweigen auf soziale Netzwerke bei denen Nutzer neue Inhalte finden und mit anderen teilen können. […]

  184. Over 200 Ajax, CSS, Flash, JavaScript, PHP, MySQL, RSS, XML and more tutorials » A blog you can use!

    […] JavaScript Fading Tooltips Sweet Titles 1.0, Documentation, JavaScript Files, CSS File […]

  185. Sweet Titles, tooltips semi transparente para los enlaces « Cosas sencillas

    […] Sweet Titles, tooltips semi transparente para los enlaces En XYBERNETICOS nos muestran a Sweet Titles es un script que nos permite generar en nuestros enlaces tooltips. Los tooltips son esos mensajes emergentes que vemos al poner nuestro cursor sobre un enlace determinado. En este caso los mostraremos en una caja emergente semi transparente muy agradable y que podemos personalizar a nuestros gustos mediante css. Puedes ver una Demo del efecto. […]

  186. Blogger Templates | Magazine Style Template - Red

    […] You can read about it here on the author site or here on google Also, why is there a separate CSS file http://akuhaus.googlepages.com/magazine-style_style.css […]

Get "JavaScript Design Patterns"

"As a web developer, you'll already know that JavaScript™ is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked--JavaScript is capable of full object-oriented capabilities, and by applying OOP principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team."

Buy JS Design Patterns from Amazon.com Buy JS Design Patterns from Apress

Flickr