views:

1169

answers:

2

I've got a popup div showing on rightclick (I know this breaks expected functionality but Google Docs does it so why not?) However the element I'm showing my popup on has a "title" attribute set which appears over the top of my div. I still want the tooltip to work but not when the popup is there.

What's the best way to stop the tooltip showing while the popup is open/openning?

Edit: I am using jQuery

A: 

I think setting to blank space and when the popup closes, setting again the proper text. I think this is the easiest way to stop it.

Javier Suero Santos
+2  A: 

With jquery you could bind the hover function to also set the title attribute to blank onmouseover and then reset it on mouse out.

$("element#id").hover(
 function() {
  $(this).attr("title","");
  $("div#popout").show();
 },
 function() {
  $("div#popout").hide();
  $(this).attr("title",originalTitle);
 }
);
Josh
nice! I am using jQuery so perfect (should have mentioned that)
Rob Stevenson-Leggett
Where is originalTitle coming from? You could store it using .data() for a more general solution.
Bobby Jack