views:

26

answers:

1

Hi, I was confused on how to use the click event in order to call another function within the class.

$.fn.imageareaselect(image)
{ 
this.click(function(){
$.fn.pinpointImage.add(image);
});
}

The selector that is passed into this function is an image. I wan't to make it so when you click the image it calls that function.

+2  A: 

jQuery's kinda funny about passing an HTML element when you'd expect a jQuery one. try using $(this) instead of this.

Also, jQuery functions like to take functions as params, but i'm not sure exactly what this code is trying to do now. The first "(image)" should probably be "= function(image)" instead.

cHao