GithubHelp home page GithubHelp logo

annanymouse / javascriptboxes Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 124 KB

Here are the rest of the requirements for the JavaScript: Box(): create a constructor function named Box to create box objects for each box that's generated. The Box object will hold each property of a box, including its id, name, color, and x and y positions. Note that the id of each box must be unique, but the name isn't (you'll have multiple boxes with the same name). boxes: an array of all the boxes. All boxes should be represented by <div> elements, and given the class "box" and a unique id. (Note that you can just use a number for an id if you want!). counter: a global variable that keeps track of the number of boxes generated, which you can use to create a unique id for each box. init(): the load handler. generate(): the click handler for the Generate! button. This function generates the <div> elements that represent the boxes. clear(): the click handler for the Clear! button. This function removes all the boxes from the scene, and resets everything so you can start from scratch. display(): the click handler for each box. When the user clicks on a box, this function will show an alert with all the information about the box, including its id, name, color, and position.

HTML 25.00% JavaScript 63.55% CSS 11.45%

javascriptboxes's People

Contributors

annanymouse avatar

Watchers

 avatar

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.