2

Well, my question is quite simple.

I'm using RaphaelJS to make a country map with hover effects, but how do I get the state ID with hover?

Imagine you have this example path.

var path = paper.path('coordinates_here');

how do I identify this path with jQuery? example:

    $('#myPathId').mouseenter(function(){
       //do something here
    });
Claudio
  • 21
  • 2

2 Answers2

4

You can use the built-in event binding of Raphaeljs like:

path.mouseover(function (event) {
    //do something
});

or you if you really want to use jQuery to do the event binding, you can do:

$(path.node).mouseenter(function(){
       //do something here
    });

assuming

var path = paper.path('coordinates_here');
Hyangelo
  • 4,784
  • 4
  • 26
  • 33
1

You will find the answer in another post: How to access id attribute of any element in Raphael

By the way: I found it by googling for "raphael path id".

Community
  • 1
  • 1
treppo
  • 547
  • 4
  • 17