tic-tac-toe/js/app.js
// Function to be called when the user moves the mouse over a box.
Function to be called when the user moves the mouse over a box.
Function to be called when the user moves the mouse over a box .
function mouseEnterBox() {
        if ($(this).hasClass("box-filled-1") || $(this).hasClass("box-filled-2")) {
            return;
        }
        if (player_O.turn) {
            $(this).css({
                'background-image': "url(" + player_O.floatImage + ")"
            });
        } else if (player_X.turn) {
            $(this).css({
                "background-image": "url(" + player_X.floatImage + ")"
            });
        }
    }
function mouseEnterBox ( ) { if ( $ ( this ) . hasClass ( "box-filled-1" ) || $ ( this ) . hasClass ( "box-filled-2" ) ) { return ; } if ( player_O . turn ) { $ ( this ) . css ( { 'background-image' : "url(" + player_O . floatImage + ")" } ) ; } else if ( player_X . turn ) { $ ( this ) . css ( { "background-image" : "url(" + player_X . floatImage + ")" } ) ; } }
Function to be called when the user moves the mouse over a box.
Function to be called when the user moves the mouse over a box .
// If the mouse enters the box and it is already picked, return the function early // If it is player O's turn, give it the float image. // If it is player X's turn, give it the float image.