GC_
GC_

Reputation: 1673

Is there a way to force Firefox to redisplay a title/tooltip?

I am using some JavaScript to change the title of an element. However, I realize now that firefox does not display the new title. You have to move the mouse off of the element, and then move it back, just to get it to work. Since I am working with a large element that take up lot of the screen, the user would not be likely get this very easlily.

Is there some way to force Firefox to redisplay the title?

Maybe there is a way to force Firefox to rerender the element or something like that?

Thanks, Grae

Upvotes: 5

Views: 1977

Answers (3)

essebibi
essebibi

Reputation: 11

I solved the same issue with this javascript. For every element where I need this behaviour I do (element is obviously the name of the element ;o) )

if (element.disabled)
{
  element.title=element.value;
}
else
{
  element.onmouseover=function(){element.title=element.value;};
  element.onmouseout=function(){element.title=null;};
}

if the element is disabled, just set the title at first... I set the element at null on the mouseover, because otherwise it will shortly show the old one and then correct it.

Upvotes: 1

Keith
Keith

Reputation: 5381

I would recommend using something like a jQuery tooltip to accomplish this, see here: http://docs.jquery.com/Plugins/tooltip

Upvotes: 2

zsalzbank
zsalzbank

Reputation: 9857

The only way I can think of is to use a library to display tooltips.

Something like this: http://flowplayer.org/tools/tooltip/index.html doesn't use actual tooltips, but can display the data easily. And I'm sure you can update the content that is displayed if needed.

Upvotes: 0

Related Questions