嗯,我的问题很简单。
我正在使用 RaphaelJS 制作具有悬停效果的国家 map ,但如何通过悬停获取州 ID?
假设您有这个示例路径。
var path = paper.path('coordinates_here');
如何使用 jQuery 识别此路径? 示例:
$('#myPathId').mouseenter(function(){
//do something here
});
最佳答案
您可以使用 Raphaeljs 的内置事件绑定(bind)像:
path.mouseover(function (event) {
//do something
});
或者如果你真的想使用 jQuery 来进行事件绑定(bind),你可以这样做:
$(path.node).mouseenter(function(){
//do something here
});
假设
var path = paper.path('coordinates_here');
关于jquery - RaphaelJS + jQuery : How to define ID and CLASSES for paths,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7236031/