简体   繁体   English

如何在翻转图像上显示信息,例如facebook人物标签

[英]How to display information on rollover image like facebook people taging

I wonder if anyone can post a code example on how I can display some information when I hover a certain pixel cordinate on an image (just like when I hover a picture on a facebook image and it displays a text of who that person is that I currently have my mouse pointer over). 我想知道是否有人可以发布一个代码示例,说明当我在图像上悬停某个像素坐标时如何显示某些信息(就像我在Facebook图像上悬停图片并显示该人的文本一样)目前将鼠标指针悬停在上方)。

The diffrence between facebook and my solution is that my picture is not a picture which contains people, but multiple graphs on same picture, so alot of image pixelcordinates is going to display some data when I hover over them. facebook和我的解决方案之间的区别在于,我的图片不是包含人的图片,而是同一张图片上的多个图形,因此当我将鼠标悬停在它们上面时,很多图像像素坐标将显示一些数据。

I also want my sollution to be webbased, and if possible only contain javascript, jquery css html. 我还希望我的解决方案基于Web,并且如果可能的话仅包含javascript,jquery css html。

Thanks so much in advance =) 提前非常感谢=)

ike @jimy says, use an image map. ike @jimy说,使用图片地图。 – Alex Thomas 6 mins ago –亚历克斯·托马斯6分钟前

But to answer your question "...wonder if anyone can post a code example..." i've done this: 但是要回答您的问题“ ...是否有人可以发布代码示例...”,我这样做是:

HTML 的HTML

<img name="n00000001" src="http://ajthomas.co.uk/shapes.png" width="300" height="300" border="0" id="n00000001" usemap="#m_00000001" alt="" /><map name="m_00000001" id="m_00000001">

<area shape="rect" coords="28,179,116,256" href="#" title="square" alt="square" />

<area shape="circle" coords="228,66, 45" href="#" title="round" alt="round" />

<area shape="poly" coords="60,32,22,72,51,120,104,109,111,54,60,32" href="#" title="Poly" alt="Poly" />

I've put it on jsfiddle for you too - http://jsfiddle.net/ajthomascouk/xsrzz/ 我也把它放在jsfiddle上-http: //jsfiddle.net/ajthomascouk/xsrzz/

I used fireworks, but i'm sure there is free tools out there too. 我曾经使用过烟花,但我敢肯定那里也有免费工具。

Hope this helps. 希望这可以帮助。

Update 更新资料

i'm sure there is free tools out there too. 我敢肯定那里也有免费工具。

Yup, Gimp can do it using this plugin 是的, Gimp可以使用此插件来完成

Good luck... 祝好运...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM