26
rated 0 times
[
28]
[
2]
/ answers: 1 / hits: 92540
/ 10 Years ago, thu, february 27, 2014, 12:00:00
here is my code:
function figureSelector () {
document.getElementById(rook).onclick = function () {
curr = 'rook';
};
};
function moveLine(){
document.getElementById(upButton).onclick = function() {
document.getElementById(curr).style.top = document.getElementById(curr).offsetTop - getPix() * 62 + px;
counter= counter + getPix();
};
I want to write an universal function for a chess piece to move. All I want is, when one clicks the chess piece, and then presses the up button, it must go up.
More From » html