【问题标题】:How to change the tool tip background color, tooltip displays in td如何更改工具提示背景颜色,工具提示在td中显示
【发布时间】:2015-06-28 04:30:52
【问题描述】:

我有一个它在鼠标悬停时显示工具提示,现在我想更改工具提示的背景颜色。 有没有办法使用 CSS 或 JQuery 或使用类属性

<td title="#487105 CLASSIC LOOSE RD124473 ENGINEERED 2X1-" class="tooltip" rowspan="10" style="white-space:nowrap;">

【问题讨论】:

  • 请在询问之前多多努力!以及我们如何使用您的代码。

标签: javascript jquery css jquery-ui jquery-plugins


【解决方案1】:

尝试在你的 td 中实现这个:

<table border="2px">
   <tr>
     <td data-toggle="tooltip" data-placement="bottom"
       title="" data-original-title="Tooltip on bottom"
       class="red-tooltip">Tooltip on bottom
     </td>
   </tr>
</table>

你可以参考这个: http://jsfiddle.net/ckxSs/585/

【讨论】:

    【解决方案2】:

    我想你会很想看到这个在 jqueryUi 中自定义工具提示的链接:

    https://jqueryui.com/tooltip/#custom-style

    希望对您有所帮助。

    谢谢!!

    【讨论】:

      【解决方案3】:
      You can use jQuery Plugin or pure css based customised tooltip.
      
      one of the way is below mentioned.
      
      **Include**
      
      jQuery 
      
       **Inside td keep like this**
          <a href="#" data-toggle="tooltip" data-placement="bottom"
             title="" data-original-title="Tooltip on bottom"
             class="red-tooltip">#487105 CLASSIC LOOSE RD124473 ENGINEERED 2X1-</a> 
      **CSS**
      
      .red-tooltip + .tooltip > .tooltip-inner {background-color: #f00;}
      
      **JS**
      
      $(document).ready(function(){
          $("a").tooltip();
      });
      

      查看示例 - http://jsfiddle.net/ckxSs/16/

      【讨论】:

      • 这里的标题是我的动态数据,来自后面的 C# 代码。无法附加所有这些项目
      • 以同样的方式在任何标签而不是标题中调用锚标记中的数据。
      猜你喜欢
      • 2020-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-31
      • 1970-01-01
      • 2021-12-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多