So, I want to show tooltips for specific buttons and not for other buttons. Here's my code with an example where I want to show tooltip with the word "TAB" on hover for the TAB button. However, if I hover over other buttons like FOO and BAR, it shows TAB too. I'm not sure what would be causing this? Is it because they share the same class even though I put a particular ID for TAB?
js function:
$('#TabBtn').mouseover(function () {
BrowserSide.Objects.ToolTip("#TabBtn", "Tab");
}).mouseout(function () {
$("#TabBtn").qtip('destroy', true);
});
Where Tooltip is:
ToolTip:function(elementId,toolTipContent){
$(elementId).parent().mouseover(function (event) {
$(this).qtip({
overwrite: false,
content: toolTipContent,
once: false,
show: {
event: event.type,
delay: 500,
ready: true,
},
position: {
my: 'top center',
at: 'top center',
target: 'mouse',
adjust: {
x: 0,
y: -35,
mouse: true // Can be omitted (e.g. default behaviour)
}
},
style: {
classes: "qtip-tooltip-for-ellipse"
}
}, event);
});
}
Html code:
<button id="TabBtn" class='newUI-toolbar-button-with-icon' style="margin:10px 8px 5px 8px; width:40px !important; height:30px !important"><span id="toolbar-TAB" class="newUI-toolbar-button-label" style="position: relative; top: -2px">Tab</span></button>
<button class='newUI-toolbar-button-with-icon' style="margin:10px 8px 5px 8px; width:40px !important; height:30px !important"><span id="toolbar-FOO" class="newUI-toolbar-button-label" style="position: relative; top: -2px; left: -4px">Foo</span></button>
<button class='newUI-toolbar-button-with-icon' style="margin:10px 8px 5px 8px; width:40px !important; height:30px !important"><span id="toolbar-BAR" class="newUI-toolbar-button-label" style="font-size: 8px !important;position: relative; top: -3px; left: -4px">Bar</span></button>
Aucun commentaire:
Enregistrer un commentaire