Options Reference
Back to the topContent
The content option allows you to specify what appears inside the tooltip. A variety of sub-options are available to you regarding data, simple text strings, HTML, and even dynamically loaded content from other local files. The content option also allows you to specify a title header for your tooltip.Back to the topPosition
The position option specifies how your tooltip will be positioned in relation to the document. First a target is specified, by default the element which the qTip method was called upon, and placed in relation to it using the corner sub-option. This can then be adjusted using the adjust sub-option's x and y values.| Name | Value | Description | ||
|---|---|---|---|---|
| target | false | HTML element to position the tooltip in relation to. Can also be set to position in relation to the mouse. |
You can position the tooltip in relation to any element. Let's position one by the last item of the first unordered list in our document:
We can also position the tooltip in relation to the mouse, so that the tooltip moves with the mouse as long as its on show:
You can also specify it as false, which positions it in relation to the element which the qtip method was called upon. This is the default behaviour.
|
|
| type | absolute | Positioning type of the tooltip e.g. absolute. In most cases absolute positioning is sufficient. |
You can use any valid CSS position value in this option including:
The default option is 'absolute' but you can also specify valid non-absolute values:
If you specify 'static', its position will be determined like a regular block element, and position adjustments will no longer work.
|
|
| container | $(document.body) | Determines the HTML element which the tooltip is appended to e.g. its container. |
By specifying the container option you can decide which element your tooltip element will be appended to:
This is useful if you want to style tooltips based on CSS selectors.
|
|
| corner: { | Object containing sub-options below | |||
| target | bottomRight | The corner of the target element by which to position the tooltip by. See the positioning tutorial for all possible corner values. |
Determines the corner of the target element which the tooltip is positioned in relation to.
By omitting the object and supplying simply a string, both the target and tooltip suboption below will be set to the corner, for example:
Is equivalent to:
|
|
| tooltip | topLeft | The corner of the tooltip to position in relation to the above targets corner. See the positioning tutorial for all possible corner values. |
Determines the corner of the tooltip element which is used to position the tooltip.
|
|
| adjust: { | Object containing sub-options below | |||
| x | 0 | Increment by which to increase the x value of the tooltip coordinate. To decrease, use a minus number. |
Use this option to specify adjustments to the x coordinate of the final tooltip position.
|
|
| y | 0 | Increment by which to increase the y value of the tooltip coordinate. To decrease, use a minus number. |
Use this option to specify adjustments to the y coordinate of the final tooltip position.
|
|
| mouse | true | Determines if the tooltips position is adjusted to the mouse position when the position.target is set to 'mouse'. |
When the position.target is the mouse, this option causes the tooltip position to respond to mouse movement when hovering over the show.target:
Alternatively, you can set it to false, which causes the tooltip to assume the position of the mouse click, but stays static:
This allows you to place the tooltip much like the right-click context menu.
|
|
| screen | false | Determines if the tooltips positioning takes into account screen width and height, preventing it from rendering off screen if possible.
Note: Your tip and target corner options may be ignored when adjusting the position. |
Set this option to true to keep the tooltip on-screen at all times, like so:
When enabled, corner positions and adjustment options may be disregarded to keep the tooltip on-screen.
|
|
| scroll | true | Determines if the tooltips position is adjusted when the document is scrolled. |
Set this option to true to adjust the tooltips position when the document is scrolled:
Alternatively, set it to false to prevent its position being updated:
|
|
| resize | true | Determines if the tooltips position is adjusted when the window is resized. |
Set this option to true to adjust the tooltips position when the window is resized:
Alternatively, set it to false to prevent its position being updated:
|
|
Back to the topShow
The show option determines how the tooltip is shown, what effect is used to display it, and when to show it e.g. what event must be triggered.| Name | Value | Description | ||
|---|---|---|---|---|
| delay | 140 | Time in milliseconds by which to delay the showing of the tooltip. |
Delay the showing of the tooltip by a set period of milliseconds. If set to zero, no delay will occur:
|
|
| solo | false | Determines whether or not the tooltip will be shown in conjunction with other tooltips or on its own |
If set to true, all other tooltips will he hidden when this tooltip is shown.
You may also specify a jQuery DOM array to select specific tooltips which should be hidden, for example:
The above code will hide all tooltips with class name 'qtip-light' before the current tooltip is shown.
|
|
| ready | false | Determines whether or not the tooltip is initially hidden or shown when ready |
If set to true, the tooltip will be shown upon creation:
If false, it will be initially hidden, which is the default behaviour.
|
|
| when: { | Object containing sub-options below | |||
| target | false | Defines the HTML element which will assigned the show event handler. |
The example below will cause the first h1 element to show the tooltip when a mouseover event occurs (default event type):
When set to false, the tooltip target element will be used e.g. the element the qtip method was called upon. This is the default behaviour.
|
|
| event | mouseover | Event type which will trigger the show event of the tooltip. All possible values are documented under jQuery's Event: bind() documentation. |
The below example will cause the tooltip to be shown when the target element is clicked:
All possible values are documented under jQuery's Event: bind() documentation.
|
|
| effect: { | Object containing sub-options below | |||
| type | fade | Effect type to use upon showing the tooltip e.g. fade, slide or grow. Can also be a callback method which will be called when the tooltip is shown. |
Create a tooltip with the 'slide' type show effect:
The object can omitted if you are not specifying any additional sub-options:
You can also specify a callback method, which allows for custom effects to be created.
The effect length is passed as a parameter to the custom callback to allow for easy referencing.
|
|
| length | 100 | Length of time in milliseconds the above effect will last for. |
This option allows you to set the length of time, in milliseconds, the above effect will occur
|
|
Back to the topHide
The hide option determines how the tooltip is hidden, what effect is used to hide it, and what event must be triggered to hide it.| Name | Value | Description | ||
|---|---|---|---|---|
| delay | 0 | Time in milliseconds by which to delay the hiding of the tooltip.
When used in conjunction with the fixed hide event, it determines the amount of time the user has to mouseover the tooltip when exiting the target element before the tooltip is hidden. When used in conjunction with the inactive hide event, it determines how long the tooltip stays visible for before being hidden, when to events are triggered on the tooltip. |
Delay the hiding of the tooltip by a set period of milliseconds. If set to zero, no delay will occur:
Allow the user 1000 milliseconds (1 second) to mouseover the tooltip when exiting the target element, before it is hidden:
Hide the tooltip after 3000 milliseconds (3 seconds) of inactivity:
|
|
| fixed | false |
For use in conjunction with mouseout and similar hide events. When set to true, the tooltip will not hide if moused over, allowing the contents to be clicked and interacted with. |
When set to true and mouseout or similar events are used, tooltips remain visible when hovered over:
This is useful for creating tooltips with functionality e.g. edit/delete links for articles etc.
|
|
| when: { | Object containing sub-options below | |||
| target | false | Defines the HTML element which will assigned the hide event handler. |
The example below will cause the first h1 element to hide the tooltip when a mouseover event occurs (default event type):
When set to false, the tooltip target element will be used e.g. the element the qtip method was called upon. This is the default behaviour.
|
|
| event | mouseover | Event type which will trigger the hide event of the tooltip. There are two custom events available: 'inactive' and 'unfocus'.
The 'unfocus' event hides the tooltip when anywhere else on the document, except the tooltip itself, is clicked. The 'inactive' event hies the tooltip after a set period of inactivity, which is determined by the hide.delay option. All other possible values are documented under jQuery's Event: bind() documentation. |
The below example will cause the tooltip to be hidden when the target element is clicked:
This one will hide the tooltip when anywhere else except the tooltip is clicked:
And this will hide the tooltip after 2 seconds of inactivity:
You can also omit the when object and simply declare a string, if your not declaring a target:
|
|
| effect: { | Object containing sub-options below | |||
| type | fade | Effect type to use upon hiding the tooltip e.g. fade, slide or grow. Can also be a callback method which will be called when the tooltip is hidden. |
Create a tooltip with the 'slide' type hide effect:
The object can omitted if you are not specifying any additional sub-options:
You can also specify a callback method, which allows for custom effects to be created.
The effect length is passed as a parameter to the custom callback to allow for easy referencing.
|
|
| length | 100 | Length of time in milliseconds the above effect will last for. |
This option allows you to set the length of time, in milliseconds, the above effect will occur
|
|
Back to the topStyle
The style option allows you to set how your tooltip styled, including many sub-options such as width, border and element classes. Each tooltip is styled according to the passed style option, allowing you to customize each tooltip separately.| Name | Value | Description | ||
|---|---|---|---|---|
| name | Name of the tooltip style to apply to the generated tooltip. |
Use this option to choose what tooltip style to apply to your tooltip. qTip comes with 5 preset styles: cream, light, dark, green and red.
Any properties that are not explicitly set in your style object will inherit values from the style you chose above. You can also create custom styles to be inherited from, which is documented here. To use a custom style, simply declare its name as the name value:
|
||
| CSS-Attribute |
Any valid CSS attribute/value pair can be specified here.
Note: Make sure to surround attribute names in quotation marks to avoid problems! |
You can declare any CSS attribute and value pair here:
Be sure to surround all your attribute names in quotation marks, as many of them contain hyphens, which are not valid charaters for object names in JavaScript! For example:
See the jQuery CSS section for more details.
|
||
| width: { | Either a number OR an object containing sub-options below | |||
| min | 0 | Determines the minimum width of the tooltip. |
Determines the minimum width of the tooltip in pixels:
If the width of the tooltip is lower than this set value at any point, it will be set to the defined value.
|
|
| max | 250 | Determines the maximum width of the tooltip. |
Determines the maximum width of the tooltip in pixels:
If the width of the tooltip exceeds this set value at any point, it will be set to the defined value.
|
|
| border: { | Object containing sub-options below | |||
| width | 3 | Determines the border width of the tooltip. |
Determines the width of the tooltips border in pixels
You can omit the object if you are not specifying any other sub-options like so:
|
|
| radius | 0 | Determines the border radius, or roundness, of the tooltip border. |
Determines the radius of the tooltips border in pixels.
It's recommended you also specify a width to prevent rendering bugs:
|
|
| color | #d3d3d3 | Determines the colour of the tooltip border |
Determines the colour of the tooltips border.
Any valid CSS color value can be used as the option value.
|
|
| tip: { | Object containing sub-options below | |||
| corner | topLeft | The corner of the tooltip the tip will be placed in relation to. See the positioning tutorial for all possible corner strings. |
Determines the corner of the tooltip on which the tip will be displayed
See the tips tutorial for all possible corner strings.
|
|
| color | false | Determines the colour of the tooltips tip. If set to false, the border colour will be used |
Determines the colour of the tooltips tip.
Any valid CSS color value can be used as the option value.
|
|
| size | {x:12,y:12} | An object containing x and y coordinates, or width and height, of the tip. |
This option allows you to set the height and width of the tip via x and y coordinates
Note: Depending on the corner which the tip is located, the x and y values could relate to either the width or the height! So watch out.
|
|
| title: { | Object containing sub-options below | |||
| CSS-Attribute |
Any valid CSS attribute/value pair can be specified here.
Note: Make sure to surround attribute names in quotation marks to avoid problems! |
You can declare any CSS attribute and value pair here:
Be sure to surround all your attribute names in quotation marks, as many of them contain hyphens, which are not valid charaters for object names in JavaScript! For example:
See the jQuery CSS section for more details.
|
||
| button: { | Object containing sub-options below | |||
| CSS-Attribute |
Any valid CSS attribute/value pair can be specified here.
Note: Make sure to surround attribute names in quotation marks to avoid problems! |
You can declare any CSS attribute and value pair here:
Be sure to surround all your attribute names in quotation marks, as many of them contain hyphens, which are not valid charaters for object names in JavaScript! For example:
See the jQuery CSS section for more details.
|
||
| classes: { | Object containing sub-options below | |||
| target | Class name assigned to the target element e.g. the element defined by the target option | |||
| tooltip | qtip | Class name assigned to the tooltip. | ||
| tip | qtip-tip | Class name assigned to the tooltip tip. | ||
| title | qtip-title | Class name assigned to the tooltip title. | ||
| content | qtip-content | Class name assigned to the tooltip content. | ||
| active | qtip-active | Class name assigned to any tooltip which is currently active e.g. on show. | ||
Back to the topAPI
The API option is simply a subset of the API Callbacks object. See here for full details and documentation.
| Name | Value | Description | ||
|---|---|---|---|---|
| api: { | Object containing sub-options below | |||
| Callback | See here for full details on all valid API callbacks for this object. | |||

