Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop title attribute from displaying tooltip temporarily?

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

like image 291
Rob Stevenson-Leggett Avatar asked Nov 13 '08 16:11

Rob Stevenson-Leggett


1 Answers

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);
 }
);
like image 76
Josh Avatar answered Sep 29 '22 03:09

Josh