I am using javascript from wz_tooltips from WalterZorn. The tool tips work fine in FireFox and Internet Explorer but they do not work at all in Safari.
The script on the Walter Zorn web site work in Safari so I’m really perplexed why I can’t get it to work.
If you would like an example of how to code a CSS tooltip, let me know. You can put images in them.
However they will appear on :hover and can appear on :focus. Safari and Chrome do not keep the :focus on something after it’s been clicked, though (the other browsers do) so if you need the tooltip to remain onscreen in ALL browsers AFTER it’s been clicked then you will want Javascript tooltips instead of CSS ones.
*edit I took a look at the Zorn JS… omigawd. That’s a LOT of code just for a wee lil’ tooltip.
Best thing to do maybe is load both your copy of the JS and his copy in a program like vi that can show diffs (whatever’s different between the two) to make sure some error wasn’t made in copying over.
Next thing would be to check your page versus his… whatever elements are getting the tooltips may need exactly the same names.
If you comment out your <links> to the CSS files, does it work (this makes sure CSS isn’t somehow interfering).
If you comment out all your other scripts you’re calling, does it work (this makes sure your other JS aren’t somehow interfering).
That’s how I’d try to track down the problem.
In fact I’d do the commenting out of JS and CSS first, because Walter Zorn’s page will not have your other CSS or scripts, so that’s an obvious first-place to try looking around. Since each browser has its own Javascript Engine, it can very well be some collision between scripts or something that simply doesn’t affect the other browsers but is toxic for Safari/Chrome.
Do CSS tooltips stay on screen when you hover over the link like the one I’m using. I have tried others but they disappear after a few seconds.
CSS tooltips remain onscreen so long as the parent is getting hovered (and also remain onscreen after a “click” if :focus is used, except in Saffy-chrome who don’t keep focus on clicked items).
The one that disappears after a while is the default one from the browser which normally is the element’s “title” attribute (except in IE, where alt attributes also show (incorrectly)).
CSS tooltips can be styled any way you want as well and can have images.
Thanks! However I did get the javascript to work in Safari. It was a problem with using the formatting tags <center> and <br>. I removed the <center> tag and replaced the <br> tags with a transparent image. It works perfectly now.
One of the reasons I like to use the javacript solution is the control and flexibility I have over how the tooltip displays.