[英]Get two tooltip bubbles but only want one
I have an image (orange circle) that shows a tooltip with a message (covered by red lines in the image): 我有一个图像(橙色圆圈),其中显示带有消息的工具提示(由图像中的红线覆盖):
However, I only want the black tooltip bubble to appear and not the generic white bubble at the bottom. 但是,我只希望显示黑色的工具提示气泡,而不希望在底部显示通用的白色气泡。
I have the following tooltip in my JavaScript at pageLoad: 我的JavaScript在pageLoad处具有以下工具提示:
$('#<%=alarmClipsDurationWarning.ClientID%>').tooltip({ 'placement': 'center right', 'title': $('#<%=alarmClipsDurationWarning.ClientID%>').attr('title'), 'delay': 0 });
HTML: HTML:
<i id="alarmClipsDurationWarning" runat="server" class="icon-exclamation-sign icon-large" style="cursor:pointer;color:orange"></i>
The title
will change when a drop down item is changed on the C# side: 在C#端更改下拉项时,
title
将更改:
alarmClipsDurationWarning.Attributes.Add("title", GetAlarmClipsDurationWarningToolTip());
GetAlarmClipsDurationWarningToolTip()
just returns a string based on the drop down change. GetAlarmClipsDurationWarningToolTip()
仅基于下拉更改返回一个字符串。 I tried doing a remove then add: 我试着做一个删除然后添加:
alarmClipsDurationWarning.Attributes.Remove("title");
alarmClipsDurationWarning.Attributes.Add("title", GetAlarmClipsDurationWarningToolTip());
And I tried this too: 我也尝试过这个:
alarmClipsDurationWarning.Attributes["title"] = GetAlarmClipsDurationWarningToolTip();
But none of them give me a single bubble. 但是他们都没有给我一个泡沫。
The white bubble is coming from the title
attribute. 白色气泡来自
title
属性。 Since you can specify exactly what content you want: 由于您可以确切指定所需的内容:
$('#<%=alarmClipsDurationWarning.ClientID%>').attr('title')
Why not use a different attribute? 为什么不使用其他属性?
alarmClipsDurationWarning.Attributes.Add("data-tooltip-content", ...
$('#<%=alarmClipsDurationWarning.ClientID%>').attr('data-tooltip-content')
Don't use the title
attribute for your tooptip. 不要为您的tooptip使用
title
属性。 There appears to be nothing about the tooptip extension that requires it. 所需的tooptip扩展似乎没有什么。 Change it to, say,
data-title
where it is set in C# and where it is read by the Tooltip extension. 将其更改为
data-title
,在C#中进行设置,并由Tooltip扩展读取。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.