We currently support three different states for a tooltip.
1. Displaying tooltip content on clicking the tooltip icon.
2. Displaying tooltip content on hovering over the tooltip icon.
3. Always displaying tooltip content(Persistent tooltip).
However, if you would like to gain more access to all the tooltips on a page and be able to display all of the tooltips content at once, close all of them at once, darken background on displaying all at once, etc., you can use our function toggleTips().
window.toggleTips(state,visibility,background);
The parameters passed to the function are:
'state' - String : 'open', 'close', 'toggle' (default is 'toggle')
This affects the state of the tooltip drop. Open will open all closed tooltips and keep all open tooltips open. Close will close all open tooltips and keep all closed tooltips closed. Toggle will open all closed tooltips and close all open tooltips.
'visibility' - String : 'visible', 'hidden' (default is 'visible')
This affects the visibility of the tooltip icon. Visible will make all icons visible. Hidden will hide all icons.
'background' - Boolean : true, false (default is false)
This affects the darkened background. True will toggle a darkened background (if a darkened background does not exist it WILL be added, if it does it WILL be removed). False will not toggle a darkened background (if a darkened background does not exist it will NOT be added, if it does it WILL be removed)
Examples:window.toggleTips();
Default toggleTips functionality. This will simply open any closed tooltips and close any open tooltips. All tooltip icons will remain visible and no background will be added (if a darkened background does exist it will be removed).
window.toggleTips('open');
Example of how to open all tooltips on page. This will open any closed tooltips and keep any open tooltips open. All tooltip icons will remain visible and no background will be added (if a darkened background does exist it will be removed).
window.toggleTips('close','hidden');
Example of how to close all tooltips on page and hide them. This will close any open tooltips and keep and closed tooltips closed. Tooltip icons will also be hidden and no background will be added (if a darkened background does exist it will be removed).
window.toggleTips('toggle','visible', true);
Example of how to toggle all tooltips on page and add a darkened background. Tooltip icons(If existent) will remain visible and a darken background will be toggled (if a darkened background does not exist it will be added, if it does it will be removed).
Comments
0 comments
Please sign in to leave a comment.