Hi,

I need to write a function for return a value when I click an image.

I've write this:


jQuery(document).ready(function(){
   $("#board").click(function(e){
        var x = e.pageX - this.offsetLeft;
        var y = e.pageY - this.offsetTop;
    if (x < 88 & y > 347){
        alert("a1");
    }
    else if (x < 88 & y > 304 & y < 347){
        alert("a2");
    }
    else if (x < 88 & y > 261 & y < 304){
        alert("a3");
    }

......
.....
.....

It's work, but there is an alternative?


Thanks,

Alfredo

Reply via email to