0

Can anyone help me with this... basically, I need to detect if any SVG path (from Raphael JS) in an array is clicked, something like this:

var myArray = [path_ur,path_us,path_ut];

myArray.bind('click',function() {
     alert('clicked');
}); 

1 Answer 1

1

You have jQuery, use it.

$.each(myArray, function() {
    $(this).on('click', function() {
     alert('clicked');
    })
}); 
1
  • Perfect, Thank you! Arrays are a weakness of mine, I must fix that :)
    – Jamie
    Feb 1, 2012 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.