Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #310

In Tooltip Magic (TMM) is there a behavior that can be used to close all of the tooltips on the page, perhaps a global tooltip closer?

The Answer

Prepared Jul. 2013 by Gerry Jacobsen, PVII

The Tooltip Magic (TTM) system includes a Control Behavior that can be used to open, close or trigger a tooltip, but this is only for a specific tooltip. You can apply this code tweak to TTM that will add a global closer behavior:

1. Open the p7TTMscripts.js file, scroll to the end of the file, make a new line and the Copy & Paste this code block into the new line:

function P7_TTMcloseAll(){
  var i,tB;
  for(i=0;i<document.p7TTMboxes.length;i++){
    tB=document.p7TTMboxes[i];
      if(tB.ttmState!='closed'){
        P7_TTMclose(tB.id);
      }
  }
}
  

2. Save and close the scripts file.

3. The behavior to close all Tooltips would look like this:

  P7_TTMcloseAll()

and when applied to a text link, the code for the link would look like this:

<a href="#" onclick="P7_TTMcloseAll();return false">Close</a>

The above link will close all of the open tooltips on the page.

Back to the questions list