Changing player's turn
i need help in changing the player's turn.
var player = 'RED';
$(function() {
$(whosturn(player)).draggable({
revert: true,
stop: {
player = 'BLUE';
}
});
});
function whosturn(player) {
if(player == 'RED') {
return '.red';
} else if(player == 'BLUE') {
return '.blue';
}
}
when the draggable stop, the player change its value to BLUE, so when i
drag the 'Drag me blue' it wont be drag. i think the program only use the
first value of the variable. sorry for some wrong grammar. thanks in
advance.
No comments:
Post a Comment