开发者

Where to find on-hover or on-select dictionaries for web pages?

开发者 https://www.devze.com 2022-12-16 19:49 出处:网络
I would 开发者_JAVA技巧like to add to my site a on-hover/on-select dictionary. What are they usually called, so I can search on the web?

I would 开发者_JAVA技巧like to add to my site a on-hover/on-select dictionary. What are they usually called, so I can search on the web?

I am thinking in a piece of javascript code that detects which word the mouse is currently hovering/selecting and after some time it shows a baloon with the hovered word definition.


Using onMouseover for this could be very annoying to your users. The NYTimes website uses the selected text (highlighted by double-clicking a word or dragging to select) to display a bubble that, when clicked, opens a popup with a query on that word or term.

See http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js.


Are you thinking of tooltips that display the definition? You can achieve this with a style sheet by adding alt tags and adding a style="cursor:help" attribute.

Alternatively you could use a tooltip library like these jQuery ones.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号