I have set up my imagemap with the jquery-plugin mapster
the code shows me, which countries are clicked ('1' for Egypt, '2' for Libyia ..)
$(document).ready(function() {
function geklickt (e){
//alert(typeof e.key); return string
$('.showme').append(e.key+ ' ');
}
$('img').mapster({
mapKey: 'ALT',
stroke: true,
strokeWidth: 2,
strokeColor: 'ff0000' ,
onConfigured: function(){
// howto set up loop for asking user here???
} ,
onClick: geklickt
});
});
My problem: I want to ask the user in a loop for different countries like this: " Click on Egypt"
if (e.key == '1')
{
// message "Ok"
// add one point
}
else
{
// message "NOT Ok"
}
"Click on Tunisia" ...
I dont know how to code this loop , so that the user is asked for the first country and then the program waits until the user has clicked a country and then the user is asked the second country ....
thanks
Kurt