鼠标悬停在图像映射上的文本 [英] Mouse-over Text on an Image Map

查看:88
本文介绍了鼠标悬停在图像映射上的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经自学了几个星期的html和css,我正在创建一个网站。



我的网站将包含一个图像当用户将鼠标悬停在地图的不同部分时,我希望该地图显示文字。



我目前依靠'title'属性来显示文本作为工具提示,但鼠标悬停和出现的文本之间存在延迟。



如果你有办法让文字立即显示在鼠标悬停上,那就足够了。

加倍努力将找到一些方法来自定义文本在鼠标悬停时的显示方式(即字体,背景颜色,框边框)。我在网站上看过这个:www.milliondollarhomepage.com,但这对我来说可能太复杂了。



帮助表示赞赏:)

I've self-studied html and css for a few weeks now, and am in the process of creating a website.

My site will contain an image map, and I want that map to show text when the user mouses over different parts of the map.

I'm currently relying on the 'title' attribute to display the text as a tooltip, but there's a delay between the mouse-over and the text appearing.

If you have some way to make the text appear immediately on the mouse-over, that would be sufficient.
Going the extra mile would be finding some way to customize how the text is displayed on mouse-over (i.e. fonts, background colour, box border). I've seen this on the site: www.milliondollarhomepage.com , but that might be too complex for me to understand.

Help is appreciated :)

推荐答案

如果没有可以生成MouseHover的不同对象我只知道一种方法:

你必须计算不同的区域您想要举办活动的地图。现在,您必须在MouseMove期间检查MousePosition是否位于您定义的某个区域内,如果是,则执行您想要在此位置执行的操作。
If there are no different objects which could generate a MouseHover I know only one way to realize that :
You have to calculate the different Areas on your map in which you want to have an Event. Now you have to check during the MouseMove if the MousePosition is inside one of your defined Areas and if Yes do what you want to do at this Position.


这篇关于鼠标悬停在图像映射上的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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