Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI Basic Plugins - Tooltip

jQuery EasyUI Basic Plugins - Tooltip


jQuery EasyUI Plugins jQuery EasyUI Plugins


Override the default defaults through $.fn.tooltip.defaults.

When the user moves the mouse pointer over an element, a tooltip window appears to display additional information. The tooltip content can contain any html elements from the page or generated via ajax.

Usage

Creating a Tooltip

1. Create a Tooltip from markup by adding the 'easyui-tooltip' class to the element; no javascript code is needed.



Hover me

2. Create a Tooltip using javascript.



Click here



$('#dd').tooltip({

    position: 'right',

    content: 'This is the tooltip message.',

    onShow: function(){

        $(this).tooltip('tip').css({

            backgroundColor: '#666',

            borderColor: '#666'

        });

    }

});

property

Name Type Description Default value
position string The tooltip position. Possible values: 'left', 'right', 'top', 'bottom'. bottom
content string The tooltip content. null
trackMouse boolean If set to true, the tooltip moves with the mouse. false
deltaX number The horizontal distance of the tooltip position. 0
deltaY number The vertical distance of the tooltip position. 0
showEvent string The event that triggers the tooltip to appear. mouseenter
hideEvent string The event that triggers the tooltip to disappear. mouseleave
showDelay number The time delay before showing the tooltip. 200
hideDelay number The time delay before hiding the tooltip. 100

Events

Name Parameters Description
onShow e Triggered when the tooltip is shown.
onHide e Triggered when the tooltip is hidden.
onUpdate content Triggered when the tooltip content is updated.
onPosition left,top Triggered when the tooltip position changes.
onDestroy none Triggered when the tooltip is destroyed.

Method

Name Parameters Description
options none Returns the options property.
tip none Returns the tip object.
arrow none Returns the arrow object.
show e Shows the tooltip.
hide e Hides the tooltip.
update content Updates the tooltip content.
reposition none Resets the tooltip position.
destroy none Destroys the tooltip.

jQuery EasyUI Plugins jQuery EasyUI Plugins