简体   繁体   English

获得两个工具提示气泡,但只想要一个

[英]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.

相关问题 我只想要一个时引用的两个版本的控件 - Two Versions of Controls Referenced when I Only Want One 如何仅在一个控件中设置工具提示? - How to set the ToolTip in only one control? 只想读一份文件 - Want to read only one document C#我希望将一个继承的类仅设置为SET,将其他继承的类仅设置为GET - C# I want one inherited class to SET only and other inherited class to GET only 当它只有一个时,如何获得两位小数 - How to get two decimal digits when it has only one C#获取斐波那契IEnumerable <int> 与递归..我希望它返回所有数字,而不仅仅是最后一个 - C# get fibonacci IEnumerable<int> with recursion.. I want it to return all the numbers, not only the last one 我有两个表(实体框架)。 我想根据彼此计算平均值,但只计算一次记录。 怎么做? - I have two tables (Entity Framework). I want to count an average based on one another, but only count one record once. How to do it? 如何让Selenium仅使用一个驱动程序硒(使用C#和chromedriver)来操作两个浏览器窗口? - How to get Selenium to operate two browser windows using only one driver selenium (using c# and chromedriver)? 我有两个Dropdownlist,但只有一个dropdownlist值应插入数据库 - I have Two Dropdownlist but Only one dropdownlist value should get insert into database 使用.Split填充字符串数组时,我只有一个条目。 我需要两个 - When using .Split to populate a string array, I only get one entry. I need two
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM