将鼠标悬停在word上时显示框中的文本

roqulrg3  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(70)

当鼠标悬停在一个单词上时,我想在R markdown文件中显示一个单词的定义。
对于一个链接,它可以这样做:[I'm an inline-style link with title](https://www.google.com "Google's Homepage")当鼠标悬停在I'm an inline-style link with title上时,文本Google's Homepage将弹出。然而,我想对一个词做同样的事情,并给予一个没有链接的框中的词的定义。
类似于:[word]("Definition of word that pops up in a box upon hovering")。这可能吗?

zd287kbt

zd287kbt1#

一个选项是tippy包。

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tippy)

This is a

tippy("word.", tooltip = "Definition of word that pops up in a box upon hovering")

I would like to know its definition.

字符串

![](https://i.stack.imgur.com/b56aY.png)
的数据
laik7k3q

laik7k3q2#

在这里找到a solution

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

Introduction to tooltip or popups

This is a word. I would like to know its definition.

字符串
如果能够更改工具提示就好了。
[This webpage](https://www.samanthaming.com/tidbits/98-html-abbr/)可以帮助您自定义标记(Abbreviate Your Code with HTML abbr Tag)。
我也在寻找一种方法来拥有一个[Wikipedia hover box style](https://en.wikipedia.org/wiki/Template:Abbr/doc)。
同样,当你悬停文本时,你可以避开“默认”框,并根据自己的喜好修改它:这个网站提供了修改“工具提示”框的例子。

相关问题