[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Thanks for your help and patience Richard!I've made those changes and it all works and looks a lot cleaner now. Thanks again, Alex On Sat, Dec 6, 2008 at 1:44 AM, Richard D. Worth <[EMAIL PROTECTED]> wrote: > I prefer $(this).data(...) to $.data(this, ... Other than that, it looks > good. > > Ok

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Richard D. Worth
I prefer $(this).data(...) to $.data(this, ... Other than that, it looks good. Ok, one minor thing. I would change: $(this).parent().append("" + title + ""); $("#places ul li span").fadeIn(); to (untested): $("" + title + "").appendTo($(this).parent()).fadeIn(); - Richard On Fri, Dec 5, 2008

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Obviously that code now has the presentational stuff for the tooltip I create and destroy. Comments on that code would be great :) This is my first go with javascript at all so... -- Alex On Sat, Dec 6, 2008 at 1:31 AM, Alex Hempton-Smith < [EMAIL PROTECTED]> wrote: > Ah I was just about to p

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Ah I was just about to post about reading up on .data, here's my current code which works, will look through yours now to see if you do it better! $("#places ul li a").hover(function() { var title = $(this).attr("title"); jQuery.data(this, "titleText", title); $(this).removeAttr("title") $(this).p

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Richard D. Worth
On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith < [EMAIL PROTECTED]> wrote: > 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: >

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
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).remov

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Jörn Zaefferer
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.

[jQuery] Re: Hiding tooltips

2008-12-05 Thread Charlie Griefer
On Fri, Dec 5, 2008 at 4:34 PM, 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 Wind