界面中的各个控件有时候会需要ToolTip的功能,其实实现ToolTip功能十分简单,代码如下所示:

function GetValueForToolTip(obj) {
var tValue = obj.innerText;
obj.setAttribute("title", tValue);
}

参数obj为我们传递控件对象,例如:一个button,Table中的一个单元格等等,简单的调用一下:

<td width="25%" onmouseover='GetValueForToolTip(this)'>HaHa</td>

用Button再调用一下:

<button >HaHa Button</button>

其他依次类推啦,如有更好的方法和建议,欢迎指教~~

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
  • 2021-05-26
  • 2021-12-22
  • 2021-06-27
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2022-03-10
  • 2022-12-23
  • 2021-06-07
相关资源
相似解决方案