弹出文字中单词的含义 [英] Pop up meaning of a word in a text

查看:48
本文介绍了弹出文字中单词的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个html文本和一个单独的特定词典,其中包含xml格式的某些单词的定义.单击,悬停或在文本中选择一个单词时,是否有一种方法可以从此字典中调整鬃毛.

可以说这是我的文字

Hi
I have an html text and an a seperate, specific dictionary which hold definitions of some words in xml format. Is there a way to pupulate maning from this dictionary when a word is clicked, hovered or selected in the text.

Lets say this is my text

Lorem Ipsum is simply dummy text of the printing and typesetting industry.



这是我的字典(在单独的文件中)



This is my dictionary (in a seperate file)

<word>dummy</word>
<definition>a copy or imitation of an object</definition>



当我单击或悬停在虚拟对象上时,弹出屏幕应在单词"dummy"上显示定义.



添加带有定义的伪链接作为标题,如下所示.
<a href="#" title="a copy or imitation of an object">dummy</a>
< a href =#" title =对象的副本或模仿">虚拟</a>就像这个

我喜欢第二个.

在此先感谢您.



When I click or hover on dummy,a pop up screen should show definiton to word "dummy".

or

add pseudo link with definition as title as shown below.
<a href="#" title="a copy or imitation of an object">dummy</a>
<a href="#" title="a copy or imitation of an object">dummy</a> just like this one

I prefer second one.

Thanks in advance.

推荐答案

您可以使用JQuery读取xml(字典)文件.一旦拥有xml数据,就可以轻松地在弹出窗口中显示它.您需要做的只是探索JQuery.以下链接可能会帮助您解决此特定问题: http://think2loud.com/reading-xml-with-jquery/ [ ^ ]
You can read the xml (dictionary) file using JQuery. Once you have the xml data with you, you can easily show it with on the pop-up. All you need to do is to explore JQuery. Below link might help you for this particular problem: http://think2loud.com/reading-xml-with-jquery/[^]


这篇关于弹出文字中单词的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆