将鼠标光标移到图像中的特定位置 [英] Change mouse cursor over specific locations in an image

查看:113
本文介绍了将鼠标光标移到图像中的特定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,如何在图像的特定位置上更改鼠标光标.

我有一个图像,其中包含我采用x和y坐标的区域
并利用该区域来做各种事情.
所以现在我有了一个onclick可以执行某些操作的脚本.

Hi how can i change mouse cursor over specific locations in an image.

i have an image that contains areas which i took the x and y coordinates
and use this areas for doing various things.
so now i have a script that onclick do something..

if( PosX > 30 && PosX < 145 && PosY > 30 && PosY < 68 ){...}



我如何在此位置更改鼠标光标?
但在mouseOver事件中则不在mouseClick事件中..
我有16个这样的不同地点,您能想到一种更简单的方法吗
而不是16 *这条线(x和y都在变化)?
对于mouseOver事件,我将需要再次复制那些16英寸的if语句?

谢谢!



how can i at this location change the mouse cursor ?
but not in mouseClick event, when mouseOver event..
I have 16 different locations like this one, can you think of a simpler way of doing it
instead of 16* this line( the x and y are changing for each one )?
and for mouseOver event i will need to copy those 16''s if statements again?

Thanks !

推荐答案

您应该使用图片映射 [ ^ ]试图重新创建轮子没有任何意义.
然后,您可以使用CSS更改光标,或仅使用area元素的onmouse ...事件来触发所需的任何JacaScript函数.
You should look at using an Image Map[^] no sense trying to recreate the wheel.
Then you could use CSS to change your cursor or just the onmouse... events of the area elements to fire whatever JacaScript functions you want.


这篇关于将鼠标光标移到图像中的特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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