I am trying to work with the JQuery UI Tooltip, and I think I can miss something.
I want the simplest possible tooltip to appear without specifying the title property.
I believe that I could call it almost everywhere in my javascript:
$('#ContactName').tooltip({ content: 'Hey, look!' }).tooltip('open');
This does not work. Am I doing something wrong?
EDIT: I should mention that #ContactName is the input [type = text] and it is in the jQuery interface dialog box.
EDIT 2: Well, it worked. I really don't understand why.
$($('#ContactName').parent()).tooltip({ items: '#ContactName', content: 'Hey, look!' });
It works on hovering. Anyway, can I, in the same code, open it immediately?
EDIT 3: This is what I ended up with:
$($('#ContactName')).tooltip({ items: '#ContactName', content: $(this).text(), position: { my: 'left+15', at: 'right center' }, tooltipClass: 'ui-state-error' }).tooltip("open");
jquery jquery-ui jquery-ui-tooltip
Josh young
source share