$(function() { $( tooltip ).tooltip({ position: { my: "left+40 center", at: "right center", items: "[title]", content: function() { var element = $( this ); if ( element.is( "[title]" ) ) { return element.attr( "title" ); } } } }); }); 

Displays a hint, and this piece of code is responsible for adding an arrow to the left of the hint:

 using: function( position, feedback ) { $( this ).css( position ); $( "<div>" ) .addClass( "arrow" ) .addClass( feedback.vertical ) .addClass( feedback.horizontal ) .appendTo( this );} 

How to correctly enter it in the first piece of code so that the tooltip pops up with an arrow?

1 answer 1

Based on the custom-style tooltip , like this:

 $(function() { $( tooltip ).tooltip({ position: { my: "left+40 center", at: "right center", using: function( position, feedback ) { $( this ).css( position ); $( "<div>" ) .addClass( "arrow" ) .addClass( feedback.vertical ) .addClass( feedback.horizontal ) .appendTo( this );} items: "[title]", content: function() { var element = $( this ); if ( element.is( "[title]" ) ) { return element.attr( "title" ); } } } }); });