将文本悬停在代码周围的文本上
正在寻找一种方法,当鼠标悬停在网站内任何位置的几个单词上时,信息文本就会显示出来。我看到有一些插件可以处理这个问题,但它们似乎在网站管理员创建的自定义内容类型中没有做任何事情。此外,它们不适用于围绕“我希望成为术语表”的文本的特定 html 标签。
例如,假设我在两个列表标签 (li) 之间有“选项 1”一词,我希望它在有人将鼠标悬停在上面时读取“这是文本” 出现在无序列表中的“选项 1”。换句话说,我特别希望它适用于包含在 (li) 标记内的“选项 1”的所有实例。
此请求是否太过牵强?也许有一种不同的方法可以完全做到这一点。我只是希望人们能够从复选框中选择选项,但有办法从列出这些选项的页面详细查看这些选项的内容。工具提示似乎对于词汇表条目很有效,所以我想也许可以做同样的事情。
似乎大多数工具提示插件都没有设置来代替 WordPress 自定义内容类型。
Was looking for a way for informational text to show up once the mouse hovers over a few words anywhere within the website. I see that there are some plugins that handle this but they dont seem to do anything witin custom content types created by the site admin. In addition, tey dont sem to work for specific html tags surrounding the text I wish to be a glossary term.
For example, lets say I have the words "Option 1" between two list tags (li) I would want it to read "Here is text" upon someone mousing over
"Option 1" which appears in an unordered list.In other words, I specifically want it to work for all instances of "Option 1" that appear enclosed within (li) tags
Is this request too far fetched? Maybe there is a different way to do this entirely. I just want people to be able ot select options from a checkbox, but have a way to see what those options are in detail from that page where they are listed. Tooltips seem to work well for glossary entries so I figured maybe the same could be done.
Seems that most of the tooltip plugins are not setup in lieu of WordPress Custom Content Types.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法就是添加
title
属性,就像制作一个如下所示的列表标签:当然,这个,你不能设置样式或修改 - 它完全由浏览器解释。或者,您可以查看创建您的自己的 工具提示,使用 Javascript 或 CSS3。
The simplest way is simply to add the
title
attribute, like to make a list tag that looks like this:Of course, this, you can't style, or modify - it's entirely interpreted by the browser. Alternatively, you could look into creating your own tooltips, using Javascript or CSS3.