jamietre/ImageMapster — Issue #22: Continuation from Issue 19!
Author: audiopleb
Created: 2011-10-12 14:03:25+00:00
State: open

Hi,

I was wondering if you could help me out a bit with this again please!

onStateChange didn't work out for me, so i've gone down the route of using the onClick event from the mapster function.

In the onclick, i'm doing this:

```
onClick: function(data)
{

if (data.key==='999') {

var stateArray = [103,114,78,72,116,33,32,117,43,35,113,112,57,96,19,10,92,23,89,51];

$('img#usa_image').mapster('set',data.state,stateArray);
}
}
```

This works okay when i click on the region to highlight it, but then deselecting (un-highlighting if you will) takes a very very long time to execute that code.

Do you have any idea as to why?

Thanks!