Giter VIP home page Giter VIP logo

Comments (2)

oakmac avatar oakmac commented on August 17, 2024

I think you're on the right track; you're going to have to track the state of both boards and update them both when one changes.

As far as adding dots to the boards, that might be trickier and you'll probably have to write some DOM manipulation code in order to achieve it. Every square gets a unique id when the board is created; it shouldn't be too hard to keep those ids in an object and append / remove your dot DOM elements as the boards change state. You can use Chrome Dev Tools to inspect the board DOM as you drag and drop pieces around the board to help get an idea of how this works internally.

from chessboardjs.

oakmac avatar oakmac commented on August 17, 2024

For the benefit of others reading this thread I should add the caveat that it is not a best practice to muck with the internal DOM structure of chessboard.js; there is always the possibility that it will change in the future.

That being said, it is very unlikely that 1) unique ids for squares and 2) the unique "hashed" CSS class names will change anytime soon.

from chessboardjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.