显示禁用物品的工具提示

编程入门 行业动态 更新时间:2024-10-28 12:23:46
本文介绍了显示禁用物品的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个禁用项目的div.我正在使用jquery ui来显示工具提示.显示的工具提示适用于启用的项目,但不适用于禁用的div.我如何也显示禁用div的工具提示? 这是我的小提琴

I have a div with disabled items. I am using jquery ui to display tool tip. Tool tip is shown for enabled items but not for disabled div. How can I show tooltip for disabled div also? Here is my fiddle

<div title="This is a tool tip test for enabled item" id="divEnabled"> item is enabled </div> <div title="This is a tool tip test for disabled item" id="divDisabled"> item is disabled </div> #divDisabled{ opacity: 0.2; pointer-events: none; }

推荐答案

您正在将指针事件设置为none,因此不会触发悬停事件.这就是为什么标题没有显示的原因.也许您应该找到另一种禁用" div的方法.

You are setting pointer events to none so the hover event is not fired. Thats why title is not shown. Maybe you should find another way to "disable" the div.

如果您只想停止div上的click事件

If you just want to stop click event on the div

<div title="This is a tool tip test for disabled item" id="divDisabled" onclick="return false;"> item is disabled </div>

会的.

但是通常单击div是没有用的,所以也许您会解释单击div会做什么,并且防止此操作会有所不同.

But normally it is useless to click on a div so maybe you would explain what are you doing on click of the div and preventing this action would be different.

更多推荐

显示禁用物品的工具提示

本文发布于:2023-11-03 16:59:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555627.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:提示   物品   工具

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!