Http://www.cnblogs.com/birdshome/archive/2005/09/01/AutoToolTip.html
It is a strict UI style that allows a web page to display lines of text that cannot be broken or do not want to be broken in a row, after all, a free discount row makes it difficult to grasp the table and the overall interface. Of course, when a row is not displayed in full time, it ends with a ellipsis. It prompts the user that the statement is not over. However, in this case, tooltip is essential to allow the user to see all the text.
Displaying tooltip on the Web is not easy. As long as you set the title attribute of the HTML element to a non-null string, it is naturally a tooltip. However, this is actually quite troublesome. Writing a title in advance will lead to several side effects: 1. Unnecessary content overhead. Due to the preset title attribute, the document will increase; 2. The tooltip is always displayed. Even if a line can be fully displayed, the tooltip is displayed. This will confuse the user and I thought I would explain something more; 3. Special characters are contained in the text to be displayed in the tooltip. For example, single quotation marks and double quotation marks are also required to encode the tooltip content on the server side.
Using the client script to process tooltip can avoid all the deficiencies and problems mentioned above. Example:
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
This is a long string. |
// The blue text is self-contained with tooltip. You can adjust the page size to see the adaptability of tooltip.
......
http://www.cnblogs.com/birdshome/archive/2005/09/01/AutoToolTip.html