I'm using this code, and the "title" variable is a local variable in the
hover-over function, and not able to be accessed from the next function -
therefore my tooltip has no content the next time I hover over:
$("#places ul li a").hover(function() {
var title = $(this).attr("title");
$(this).removeAttr("title")
}, function() {
$(this).attr({
title: title
});
});

(I've removed my custom tooltip code for clarity and I'm just focussing on
the title stuff here).

Is there any way I could enclose the whole lot in a function and store the
variable in an enclosing function perhaps?

-- Alex


On Sat, Dec 6, 2008 at 12:43 AM, Jörn Zaefferer <
[EMAIL PROTECTED]> wrote:

> Store the title in a variable, remove it from the element, and restore
> it on mouseout.
>
> Jörn
>
> On Sat, Dec 6, 2008 at 1:34 AM, Alex Hempton-Smith
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I'm using the "title" attribute to create my own custom tooltip, very
> simple
> > so it doesn't really need a plugin.
> > Everything works fine, except I would like to hide the default tooltip
> > (yellow on Windows). How would I go about this?
> > How do the tooltip plugins do it?
> >
> > Many thanks,
> > Alex
> >
>

Reply via email to