12th April, 07:41
There are so many great sample implementations for various use cases of qTip2 (and some that are asked for repeatedly) that I thought I'd start organizing them into a list for all. This isn't a complete list by any means, so if you have any others to add just let me know. I'll try to update/reorganize this as often as I can.
Content
Use tooltip content from hidden elements located within the tooltip trigger itself
Use tootip content from a unique, hidden DIV element on the page, with an ID attribute based on the trigger's
Create a base, shared qTip configuration that is modified by some custom settings per tip
Use a single master tip for all tooltip triggers on the page rather than one tip for each
Toggle the contents of a tooltip on trigger click
Display a tooltip containing the highlighted text on a page
Retain the standard browser tooltip: Prerendered qTip / Non-prerendered qTip
Load content from an external file
Style
Have tooltips with different widths
Make the tooltip's width a percentage of the page or another element
Transparent tooltip (including content)
Transparent tooltip (background only)
Position
Position a tooltip absolutely to the page or a containing element
Position tooltips absolutely horizontally while keeping the vertical axis aligned with the tooltip trigger
Initialize qTips in a child iFrame so that they display outside the iFrame and position them relative to the iFrame
Behavior
Hide the tooltip when the user clicks anywhere on the page
Set focus on a form field within a tooltip
Hide all tips when a form field is blurred
Persist a tooltip until the user actively clicks the close button on the tip (with hover intent behavior) alt
When the user preses the CONTROL key, make the tip that is currently being displayed "static" at the mouse position until they click somewhere on the tooltip
Dynamically change the hide delay of a tooltip
Dynamically modify events after qTip initialization
Hide tip on pressing ESC key: Modal tip / Non-modal tip / Non-modal tip with temp event binding via namespace
Cancel a qTip's show event when using hover intent behavior
Test Cases
Form fields in tooltip
Content
Use tooltip content from hidden elements located within the tooltip trigger itself
Use tootip content from a unique, hidden DIV element on the page, with an ID attribute based on the trigger's
Create a base, shared qTip configuration that is modified by some custom settings per tip
Use a single master tip for all tooltip triggers on the page rather than one tip for each
Toggle the contents of a tooltip on trigger click
Display a tooltip containing the highlighted text on a page
Retain the standard browser tooltip: Prerendered qTip / Non-prerendered qTip
Load content from an external file
Style
Have tooltips with different widths
Make the tooltip's width a percentage of the page or another element
Transparent tooltip (including content)
Transparent tooltip (background only)
Position
Position a tooltip absolutely to the page or a containing element
Position tooltips absolutely horizontally while keeping the vertical axis aligned with the tooltip trigger
Initialize qTips in a child iFrame so that they display outside the iFrame and position them relative to the iFrame
Behavior
Hide the tooltip when the user clicks anywhere on the page
Set focus on a form field within a tooltip
Hide all tips when a form field is blurred
Persist a tooltip until the user actively clicks the close button on the tip (with hover intent behavior) alt
When the user preses the CONTROL key, make the tip that is currently being displayed "static" at the mouse position until they click somewhere on the tooltip
Dynamically change the hide delay of a tooltip
Dynamically modify events after qTip initialization
Hide tip on pressing ESC key: Modal tip / Non-modal tip / Non-modal tip with temp event binding via namespace
Cancel a qTip's show event when using hover intent behavior
Test Cases
Form fields in tooltip