JavaScript/jQuery Tooltip - Resize and Relocate

To change the size of the Tooltip, specify the height and width properties. Note that the Tooltip's arrow takes its share of the overall size.

JavaScript
HTML
  • $(function() {
  • $("#tooltipContainer").dxTooltip({
  • target: "#image",
  • showEvent: 'dxhoverstart',
  • hideEvent: 'dxhoverend',
  • height: 70,
  • width: 200,
  • contentTemplate: function (contentElement) {
  • contentElement.append(
  • $("<p />").text("Tooltip content")
  • )
  • }
  • });
  • });
  • <img id="image" src="https://url/to/an/image" />
  • <div id="tooltipContainer"></div>

If you need to position the Tooltip against a certain side of the target element, set the position property.

JavaScript
HTML
  • $(function() {
  • $("#tooltipContainer").dxTooltip({
  • target: "#image",
  • showEvent: 'dxhoverstart',
  • hideEvent: 'dxhoverend',
  • position: "top", // or "bottom" | "left" | "right"
  • contentTemplate: function (contentElement) {
  • contentElement.append(
  • $("<p />").text("Tooltip content")
  • )
  • }
  • });
  • });
  • <img id="image" src="https://url/to/an/image" />
  • <div id="tooltipContainer"></div>
See Also