How-To create a JavaScript tooltip / popup

If you want to create a tooltip to show additional information, you can use the SharePoint functionality to do so. E.g. on a list of websites you could show the website’s description, if the user moves the mouse over the element.

The JavaScript which will show the “Open Menu” text is “MMU_PopMenuIfShowing(this);”. It is referenced on all SharePoint sites through the call to Init.js in the header.

So how do you use it? How does it work?

The JavaScript function is called the “this” as parameter. Meaning the current element is passed to the function. It will then use the “title” Attribute of the current element to show the tooltip.

 1: <table title=“The tooltip text goes here” onmouseover=“MMU_PopMenuIfShowing(this);">

<span class=lnum>   2:  </span>...

If you now move the mouse over the table, the tooltip will be shown.

Technorati Tags: ,,