jQuery触摸事件以在移动设备上模拟鼠标事件

时间:2012-11-17 18:06:23

标签: jquery touch

我有一个区域图,当用户将鼠标移到/移出不同的地图区域项目时,我会显示/隐藏区域地图图像旁边的图像。我还捕获地图区域项目上的点击并执行一些功能。现在,我希望在没有鼠标(即手指)的设备上为用户提供此功能。

鼠标翻转/输出/点击的代码是:

$('area[id^="maparea"]').mouseover(function () {
    // show image associated with this map area item
});
$('area[id^="maparea"]').mouseout(function () {
// hide image associated with this map area item
});
$('area[id^="maparea"]').click(function () {
    // select the image associated with the map area item
});

如何在触摸事件中使用类似的功能?

点击事件应继续按原样运行。当你用手指围绕我感兴趣的区域地图(不抬起手指)时,动态改变图像。

提前致谢。

1 个答案:

答案 0 :(得分:1)