Forcing all browser tooltips to show simultaneously

3

1

I'd like to take a screenshot of a web page showing all of the element tooltips at once. Is this possible?

For clarity, I'm trying to show the native tooltips that Chrome/Firefox show when you hover the cursor over an element. The text is usually taken from the 'title' attribute, or the 'alt' attribute for an image.

The reason is that I need to get the text of many tooltips on a complex page verified, without taking dozens of screenshots. Exporting the text from the HTML isn't suitable, since the tooltips need to be seen in context.

Forcing each element's state to ':hover' doesn't do the trick. That changes the CSS, but doesn't show the tooltips.

A solution that works in either Chrome or Firefox would be great.

Thanks!

grw

Posted 2017-05-04T08:50:02.737

Reputation: 246

Answers

0

This is impossible to achieve. Tooltips is a windows function and windows determined that if another tooltip is shown, the first one has to be removed.

Under the hood, what actually happens, is that the same tooltip is reused. Text is altered, and its position is altered.

LPChip

Posted 2017-05-04T08:50:02.737

Reputation: 42 190

Thanks for the answer.

I've decided to go for an alternative approach: add JQuery UI tooltips, which use JavaScript to read all the 'title' and 'alt' elements and create real DOM elements for the tooltips.

That way, I can use the jQuery API to trigger the 'virtual' tooltips. – grw – 2017-05-12T08:46:28.263